Hello,
I'm trying to port some code from OJB over to Hibernate. OJB had an "addSql" method on its Criteria class which enabled one to add an aribtrary filter.
For example,
Code:
Criteria criteria = new Criteria();
String accessFilter = " AccessControl.Id = " + id + " AND AccessControl.Access = 'PUBLIC' ";
criteria.addSql(accessFilter);
As you can see, we used this for an instance-level public/private authorization scheme. I looked through the Hibernate reference guide, but the SQL query mechanism (covered in Ch 15) seems to target complete SQL queries, whereas I just want to add a SQL where clause to a Hibernate query.
Is there a way to do this?
TIA,
Alex