Hi!
Tried to make an self join with the same table with the following DetachedCriteria:
Code:
Criteria crit = session.createCriteria(entityType,"resultAlias");
DetachedCriteria subselect = DetachedCriteria.forClass( Produkt.class, "inner" );
subselect.add( Restrictions.eqProperty( "inner.sub","resultAlias.sub") );
subselect.add( Restrictions.eqProperty( "inner.kennung", "resultAlias.kennung" );
subselect.setProjection( Projections.property( "status" ) );
crit.add( Subqueries.leAll( "0", subselect ) );
Output:
Code:
select ....
from PRODUKT alias_result_ where 0 <= all (select inner_.status as y0_ from PRODUKT inner_ where
(sub=sub) and kennung=kennung);
I am missing the alias at the join !
expected SQL:
Code:
select ....
from PRODUKT alias_result_ where 0 <= all (select inner_.status as y0_ from PRODUKT inner_ where
(alias_result_.sub=inner_.sub) and alias_result_.kennung=inner_.kennung);
I am using hibernate version 3.2.6 what do I wrong ?