Skip to content

Creating type-safe comparators and hamcrest matchers using the generated QueryDSL metamodel

Notifications You must be signed in to change notification settings

jeroenvs/querydsl-support

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

QCar $ = QCar.car;

Matcher

Car car = new Car().setHorsePower(123);
assertThat(car, hasValue($.horsePower, equalTo(123)));

Comparator

Car car = new Car().setHorsePower(50);
Car betterCar = new Car().setHorsePower(150);
assertEquals(-1, pathComparator($.horsePower).compare(car, betterCar));

Future ideas:
 - Sort definition: new MutableSortDefinition($.horsePower, true, true)
 - Bean wrapper: getPropertyDescriptor($.horsePower)
 - Sort builder: asc($.horsePower, $.model) -> Sort (Spring Data JPA)

About

Creating type-safe comparators and hamcrest matchers using the generated QueryDSL metamodel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages