Skip to content

Instantly share code, notes, and snippets.

@dmilith
Created July 28, 2009 15:42
Show Gist options
  • Select an option

  • Save dmilith/157462 to your computer and use it in GitHub Desktop.

Select an option

Save dmilith/157462 to your computer and use it in GitHub Desktop.
// Find all employees older than 31
Query q = pm.newQuery("Native", new NativeQuery()
{
public boolean match(Object e)
{
if (!(e instanceof Employee))
{
return false;
}
return ((Employee)e).getAge() >= 32;
}
public Class getObjectType()
{
return Employee.class;
}
});
List results = (List)q.execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment