Enums in HQL contains
Bug #800698 reported by
Samppa Saarela
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hibernate cannot guess sqlType of an enum parameter in ":x in elements(
Querydsl should record enum type (string or ordinal) to EnumPath and convert enum parameters directly to integer or string before calling Hibernate's Query.setParame
To post a comment you must log in.
As annotation processor and query types (EnumPath) are general, it hardly seems appropriate to put there some Hibernate- bug-specific hacks. Could this be worked around like...
1) Collect all property related annotations (including @Enumerated) to Path. As these cannot be annotations of the path field itself, the path should provide a method for getting annotations of the original member. In addition to this bug-workaround, these annotations could be used e.g. for validation of (batch) update parameters using validation annotations of the original member. This could be useful for some applications also.
2) In Hibernate specific JPQLSerializer extension visitOperation could check if a) first parameter is an enum constant and b) second argument (e.g. SetPath) has optional @Enumerated annotation. Then it could change the enum constant to ordinal integer or name string before calling super.visitOper ation.
?