Skip to content

mysema/vaadin-querydsl-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vaadin Querydsl prototype

Prototype of Vaadin/Querydsl JPA integration

vaadin-querydsl-prototype provides extensions to the Vaadin JPAContainer methods to support Querydsl types.

QuerydslJPAContainerFactory and QuerydslJPAContainer can be used as replacements for JPAContainerFactory and JPAContainer.

Usage

creation

QuerydslJPAContainer<Person> container = QuerydslJPAContainerFactory.make(Person.class, entityManager);

filtering

// container.addContainerFilter(new Equal("firstName", "Hello"));
// container.addContainerFilter(new Equal("lastName", "World"));
QPerson person = QPerson.person; // Querydsl generated type
container.addContainerFilter(person.firstName.eq("Hello"));
container.addContainerFilter(person.lastName.eq("World"));

filtering and sorting

// container.addContainerFilter(new Equal("firstName", "Hello"));
// container.sort(new Object[] { "firstName" }, new boolean[] { true });
container.addContainerFilter(person.firstName.eq("Hello"));
container.sort(person.firstName.asc());

complex filter

// container.addContainerFilter(new Or(new Equal("firstName", "Hello"), 
                                       new Equal("lastName", "World")));
container.addContainerFilter(person.firstName.eq("Hello")
                             .or(person.lastName.eq("World")));

The commented out code shows the original way to add filters and sorting.

The supported Querydsl operations are and, or, not, like, eq, ne, isNull, startsWith, startsWithIc, contains, between, lt, gt, loe and goe.

This code is just a prototype of a possible integration of Vaadin and Querydsl for JPA querying. It should not be used in production code.

About

Prototype of Vaadin/Querydsl JPA integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages