HHH-6766 - Documentation
This commit is contained in:
parent
c74610bd80
commit
cbbc786f18
|
@ -485,6 +485,18 @@ session.createCriteria(Cat.class)
|
|||
.add( Property.forName("cat2.sex").eqProperty("cat.sex") );
|
||||
session.createCriteria(Cat.class, "cat")
|
||||
.add( Property.forName("weight").gt(avgWeightForSex) )
|
||||
.list();]]></programlisting>
|
||||
|
||||
<para>
|
||||
Example of multi-column restriction based on a subquery:
|
||||
</para>
|
||||
|
||||
<programlisting role="JAVA"><![CDATA[DetachedCriteria sizeQuery = DetachedCriteria.forClass( Man.class )
|
||||
.setProjection( Projections.projectionList().add( Projections.property( "weight" ) )
|
||||
.add( Projections.property( "height" ) ) )
|
||||
.add( Restrictions.eq( "name", "John" ) );
|
||||
session.createCriteria( Woman.class )
|
||||
.add( Subqueries.propertiesEq( new String[] { "weight", "height" }, sizeQuery ) )
|
||||
.list();]]></programlisting>
|
||||
|
||||
</section>
|
||||
|
|
Loading…
Reference in New Issue