File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1313
1414import org .hibernate .Query ;
1515import org .hibernate .Session ;
16+ import org .hibernate .envers .RevisionType ;
17+ import org .hibernate .envers .internal .entities .RevisionTypeType ;
1618import org .hibernate .envers .internal .tools .MutableInteger ;
1719import org .hibernate .envers .internal .tools .StringTools ;
1820import org .hibernate .envers .tools .Pair ;
21+ import org .hibernate .type .CustomType ;
1922
2023/**
2124 * A class for incrementally building a HQL query.
@@ -222,9 +225,18 @@ public Query toQuery(Session session) {
222225
223226 final Query query = session .createQuery ( querySb .toString () );
224227 for ( Map .Entry <String , Object > paramValue : queryParamValues .entrySet () ) {
225- query .setParameter ( paramValue .getKey (), paramValue .getValue () );
228+ if ( paramValue .getValue () instanceof RevisionType ) {
229+ // this is needed when the ClassicQueryTranslatorFactory is used
230+ query .setParameter (
231+ paramValue .getKey (),
232+ paramValue .getValue (),
233+ new CustomType ( new RevisionTypeType () )
234+ );
235+ }
236+ else {
237+ query .setParameter ( paramValue .getKey (), paramValue .getValue () );
238+ }
226239 }
227-
228240 return query ;
229241 }
230242}
You can’t perform that action at this time.
0 commit comments