Using SQL to query in-memory Java collections in pureQuery

You can use annotated or inline methods to query in-memory Java collections, such as arrays, classes that implement java.lang.Iterable, and classes that implement java.util.Iterator.

With queries over collections, you can use SQL to filter a set of objects that are returned by a query on a database object. The objects are materialized by a previous query against a connected data source. You can use any SELECT statement that conforms to the SQL 92 standard.

For example, you run a query against the database table CUSTOMER, populating a List object with one Customer object per record in the table. Then, you perform a query on the List object. The second query is a query over a collection. For this second query and all subsequent queries on the List object, you no longer need the connection to the database because the content of the List object resides in memory.

Attention: When you use Iterator objects, keep in mind the following points:

Feedback