Support for query by example.
List results = session.createCriteria(Parent.class)
.add( Example.create(parent).ignoreCase() )
.createCriteria("child")
.add( Example.create( parent.getChild() ) )
.list();
"Examples" may be mixed and matched with "Expressions" in the same
Criteria.
addPropertyTypedValue
protected void addPropertyTypedValue(Object value,
Type type,
List list)
create
public static Example create(Object entity)
Create a new instance, which includes all non-null properties
by default
- a new instance of Example
enableLike
public Example enableLike()
Use the "like" operator for all string-valued properties
enableLike
public Example enableLike(MatchMode matchMode)
Use the "like" operator for all string-valued properties
excludeNone
public Example excludeNone()
Don't exclude null or zero-valued properties
excludeProperty
public Example excludeProperty(String name)
Exclude a particular named property
excludeZeroes
public Example excludeZeroes()
Exclude zero-valued properties
ignoreCase
public Example ignoreCase()
Ignore case for all string-valued properties
setEscapeCharacter
public Example setEscapeCharacter(Character escapeCharacter)
Set escape character for "like" clause
toString
public String toString()