JPA 2.0 Criteria API extension to Lazy Query Container add-on
This add-on uses JPA 2.0 type-safe queries written using the Criteria API, that automatically generate SQL for the programmer. The containers in this add-on automatically figure out the properties for the container, no manual step is required.
In simple situations that involve only one table, no query programming is needed, and the Vaadin Filterable and Sortable mechanisms are directly supported. The CriteriaContainer class supports this usage. It is also possible to program queries for grouping, sorting, filtering and any situation where more control is required. CriteriaContainer supports the addition of entities to the container.,
A second container allows retrieval of joined tables, and the creation of containers where a given item comes from any number of joined entities and computed values. The BeanTupleContainer supports this generalized access. Also, each of the entities returned is editable. When an entity appears in several tuples, it is the same entity -- changing the entity will be reflected everywhere when the item is written and the container refreshed. When using BeanTupleContainer, adding entities is done using the JPA API persist() function, and refreshing the container.
Nested properties are supported. For example, if the Person entity is joined to the Task entity via the assignedTo relationship, it will be possible to retrieve all the Person,Task pairs for which this relationship is true, and the item will allow retrieval of Person.name and Task.dueDate as item properties if these fields are present in the entities. The full Jakarta PropertyUtils syntax is supported, so you can also invoke getters on the retrieved objects.