이 콘텐츠는 선택한 언어로 제공되지 않습니다.
15.6. Example Queries
The class
org.hibernate.criterion.Example allows you to construct a query criterion from a given instance.
Version properties, identifiers and associations are ignored. By default, null valued properties are excluded.
You can adjust how the
Example is applied.
You can even use examples to place criteria upon associated objects.
List results = session.createCriteria(Cat.class)
.add( Example.create(cat) )
.createCriteria("mate")
.add( Example.create( cat.getMate() ) )
.list();
List results = session.createCriteria(Cat.class)
.add( Example.create(cat) )
.createCriteria("mate")
.add( Example.create( cat.getMate() ) )
.list();