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.
org.hibernate.Criteria
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| public static interface | Example.PropertySelector
A strategy for choosing property values for inclusion in the query criteria |
| Modifier and Type | Field and Description |
|---|---|
| private static final Example. | |
| private final Object | |
| private Character | |
| private final Set | |
| private boolean | |
| private boolean | |
| private MatchMode | |
| private static final Example. | |
| private static final Example. | |
| private Example. | |
| private static final Object[] |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addComponentTypedValues(String path, Object component, CompositeType type, List<E> list, Criteria criteria, CriteriaQuery criteriaQuery)
|
| protected void | |
| protected void | appendComponentCondition(String path, Object component, CompositeType type, Criteria criteria, CriteriaQuery criteriaQuery, StringBuffer buf)
|
| protected void | appendPropertyCondition(String propertyName, Object propertyValue, Criteria criteria, CriteriaQuery cq, StringBuffer buf)
|
| public static Example | |
| public Example | |
| public Example | |
| public Example | |
| public Example | |
| public Example | |
| private EntityMode | |
| public TypedValue[] | getTypedValues(Criteria
The local criteria criteria, CriteriaQuery The overal criteria query criteriaQuery)Implements org. |
| public Example | |
| private boolean | |
| public Example | |
| public Example | |
| public String | toSqlString(Criteria
The local criteria criteria, CriteriaQuery The overal criteria query criteriaQuery)Implements org. |
| public String |
| ALL | back to summary |
|---|---|
| private static final Example. | |
| entity | back to summary |
|---|---|
| private final Object entity | |
| escapeCharacter | back to summary |
|---|---|
| private Character escapeCharacter | |
| excludedProperties | back to summary |
|---|---|
| private final Set<E> excludedProperties | |
| isIgnoreCaseEnabled | back to summary |
|---|---|
| private boolean isIgnoreCaseEnabled | |
| isLikeEnabled | back to summary |
|---|---|
| private boolean isLikeEnabled | |
| matchMode | back to summary |
|---|---|
| private MatchMode matchMode | |
| NOT_NULL | back to summary |
|---|---|
| private static final Example. | |
| NOT_NULL_OR_ZERO | back to summary |
|---|---|
| private static final Example. | |
| selector | back to summary |
|---|---|
| private Example. | |
| TYPED_VALUES | back to summary |
|---|---|
| private static final Object[] TYPED_VALUES | |
| Example | back to summary |
|---|---|
| protected Example(Object entity, Example. | |
| addComponentTypedValues | back to summary |
|---|---|
| protected void addComponentTypedValues(String path, Object component, CompositeType type, List<E> list, Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException | |
| addPropertyTypedValue | back to summary |
|---|---|
| protected void addPropertyTypedValue(Object value, Type type, List<E> list) | |
| appendComponentCondition | back to summary |
|---|---|
| protected void appendComponentCondition(String path, Object component, CompositeType type, Criteria criteria, CriteriaQuery criteriaQuery, StringBuffer buf) throws HibernateException | |
| appendPropertyCondition | back to summary |
|---|---|
| protected void appendPropertyCondition(String propertyName, Object propertyValue, Criteria criteria, CriteriaQuery cq, StringBuffer buf) throws HibernateException | |
| create | back to summary |
|---|---|
| public static Example create(Object entity) Create a new instance, which includes all non-null properties by default
| |
| enableLike | back to summary |
|---|---|
| public Example enableLike(MatchMode matchMode) Use the "like" operator for all string-valued properties | |
| enableLike | back to summary |
|---|---|
| public Example enableLike() Use the "like" operator for all string-valued properties | |
| excludeNone | back to summary |
|---|---|
| public Example excludeNone() Don't exclude null or zero-valued properties | |
| excludeProperty | back to summary |
|---|---|
| public Example excludeProperty(String name) Exclude a particular named property | |
| excludeZeroes | back to summary |
|---|---|
| public Example excludeZeroes() Exclude zero-valued properties | |
| getEntityMode | back to summary |
|---|---|
| private EntityMode getEntityMode(Criteria criteria, CriteriaQuery criteriaQuery) | |
| getTypedValues | back to summary |
|---|---|
| public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException Implements org. Doc from org. Return typed values for all parameters in the rendered SQL fragment
| |
| ignoreCase | back to summary |
|---|---|
| public Example ignoreCase() Ignore case for all string-valued properties | |
| isPropertyIncluded | back to summary |
|---|---|
| private boolean isPropertyIncluded(Object value, String name, Type type) | |
| setEscapeCharacter | back to summary |
|---|---|
| public Example setEscapeCharacter(Character escapeCharacter) Set escape character for "like" clause | |
| setPropertySelector | back to summary |
|---|---|
| public Example setPropertySelector(Example. Set the property selector | |
| toSqlString | back to summary |
|---|---|
| public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException Implements org. Doc from org. Render the SQL fragment
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | include(Object object, String propertyName, Type type)
Implements org. |
| private Object |
| AllPropertySelector | back to summary |
|---|---|
| pack-priv AllPropertySelector() | |
| include | back to summary |
|---|---|
| public boolean include(Object object, String propertyName, Type type) Implements org. | |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | include(Object object, String propertyName, Type type)
Implements org. |
| private Object |
| NotNullOrZeroPropertySelector | back to summary |
|---|---|
| pack-priv NotNullOrZeroPropertySelector() | |
| include | back to summary |
|---|---|
| public boolean include(Object object, String propertyName, Type type) Implements org. | |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | include(Object object, String propertyName, Type type)
Implements org. |
| private Object |
| NotNullPropertySelector | back to summary |
|---|---|
| pack-priv NotNullPropertySelector() | |
| include | back to summary |
|---|---|
| public boolean include(Object object, String propertyName, Type type) Implements org. | |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| include | back to summary |
|---|---|
| public boolean include(Object propertyValue, String propertyName, Type type) | |