It is not possible to apply query extensions to primitive types
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Fix Released
|
Medium
|
Timo Westkämper |
Bug Description
Actually, I don't know if this is specific to JPA APT or APT in general.
Normally, for entity attributes which are boolean, I prefer to use the primitive type.
However, I tried to apply a query extension on it. My first attempt was to use:
@QueryDeleg
public static Predicate isFalse(BooleanPath path) {
return path.isNotNull(
}
@QueryDeleg
public static Predicate isTrue(BooleanPath path) {
return path.eq(true);
}
However, using those didn't cause the primitive boolean paths to be extended. Then I replaced Boolean.class with boolean.class (the primitive), and the annotation processor throws an error. Here are the last lines:
java.
at com.mysema.
at com.mysema.
at com.mysema.
at com.mysema.
at com.mysema.
My suggestion would be that the extensions should be applied over wrapper types (Integer, Boolean...) and also be applied to the respective primitive types. Would this be possible?
Changed in querydsl: | |
importance: | Undecided → Medium |
Changed in querydsl: | |
status: | In Progress → Fix Committed |
Thanks for the bug report. I commited a fix to SVN trunk. Could you verify that the solution works for you?