Package org.hibernate.criterion
Class NaturalIdentifier
- java.lang.Object
-
- org.hibernate.criterion.NaturalIdentifier
-
- All Implemented Interfaces:
Serializable,Criterion
public class NaturalIdentifier extends Object implements Criterion
An expression pertaining to an entity's defined natural identifier
-
-
Constructor Summary
Constructors Constructor Description NaturalIdentifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>getNaturalIdValues()Get a map of set of the natural identifier values set on this criterion (for composite natural identifiers this need not be the full set of properties).TypedValue[]getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)Return typed values for all parameters in the rendered SQL fragmentNaturalIdentifierset(String property, Object value)Set a natural identifier value for this expressionStringtoSqlString(Criteria criteria, CriteriaQuery criteriaQuery)Render the SQL fragment
-
-
-
Method Detail
-
getTypedValues
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException
Description copied from interface:CriterionReturn typed values for all parameters in the rendered SQL fragment- Specified by:
getTypedValuesin interfaceCriterion- Parameters:
criteria- The local criteriacriteriaQuery- The overall criteria query- Returns:
- The types values (for binding)
- Throws:
HibernateException- Problem determining types.
-
toSqlString
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException
Description copied from interface:CriterionRender the SQL fragment- Specified by:
toSqlStringin interfaceCriterion- Parameters:
criteria- The local criteriacriteriaQuery- The overall criteria query- Returns:
- The generated SQL fragment
- Throws:
HibernateException- Problem during rendering.
-
getNaturalIdValues
public Map<String,Object> getNaturalIdValues()
Get a map of set of the natural identifier values set on this criterion (for composite natural identifiers this need not be the full set of properties).- Returns:
- The value map.
-
set
public NaturalIdentifier set(String property, Object value)
Set a natural identifier value for this expression- Parameters:
property- The specific property namevalue- The value to use- Returns:
this, for method chaining
-
-