このコンテンツは選択した言語では利用できません。
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();