Filtering

Mostly you do not want to see all objects of a class as the result of a query. That's why you should use filtering.

Filtering is made by specifying search criteria that reduce the number of rows in a result set by specifying restrictions for certain attributes. For example, an attribute's value could be equal to the same value or less/greater than a specific value you provide.

You define such a filter by using a query language. A filter is a simple string that is passed by using the method setFilter() or, while creating the query, using the newQuery() method. The following example restricts the result set to all persons with the last name "Miller":

Query query = pm.newQuery(Person.class, "lastName == \"Miller\"");
Collection results = (Collection)query.execute();
...

Please note that the query is used by identifying the class and not the table. You always use the class itself and their attributes. At no time you should use the name of tables or table column names. Signsoft intelliBO automatically translates the names of attributes to table column names.