Hibernate version: 3.05
I'd like to be able to add the following type of criteria restriction:
Code:
List cats = sess.createCriteria(Cat.class)
.add ( /* .... other normal fixed restrictions */ )
.add( Restrictions.hsql(hsqlFilter) ) // add dynamic HSQL restriction
.list();
Unfortunately only SQL filters are supported via Restrictions.sqlRestriction().
I need support for HSQL filters via something like Restrictions.hsqlRestriction(hsqlFilter) .
I want to store a HSQL filter as a string and have Hibernate parse it at runtime and apply it as an additional criteria restriction in conjunctions with other fixed criteria. In particaluar I don't want to reference SQL field names, rather I want to use the Class field names understood by HSQL. I need these filters to understand class inheritance - just like normal HSQL does.