I have a criteria, which I'm trying to join to a database view. I'm wondering if it's possible and if so how to do it?
As I understand, createAlias
and createCriteria
only join to child objects of the root criteria. I read about detachedCriteria
, but it seems that those need to be created on database entities, which the view is not.
The HQL equivalent would be something like this
select * from root_criteria rc where rc.id in
(select view.id from DATABASE_VW view where view.field is not null)
Thanks in advance