Package org.hibernate.criterion
Class Junction
- java.lang.Object
-
- org.hibernate.criterion.Junction
-
- All Implemented Interfaces:
java.io.Serializable,Criterion
- Direct Known Subclasses:
Conjunction,Disjunction
public class Junction extends java.lang.Object implements Criterion
A sequence of a logical expressions combined by some associative logical operator- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJunction.NatureThe type of junction
-
Constructor Summary
Constructors Modifier Constructor Description protectedJunction(Junction.Nature nature)protectedJunction(Junction.Nature nature, Criterion... criterion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Junctionadd(Criterion criterion)Adds a criterion to the junction (and/or)java.lang.Iterable<Criterion>conditions()Access the conditions making up the junctionJunction.NaturegetNature()TypedValue[]getTypedValues(Criteria crit, CriteriaQuery criteriaQuery)Return typed values for all parameters in the rendered SQL fragmentjava.lang.StringtoSqlString(Criteria crit, CriteriaQuery criteriaQuery)Render the SQL fragmentjava.lang.StringtoString()
-
-
-
Constructor Detail
-
Junction
protected Junction(Junction.Nature nature)
-
Junction
protected Junction(Junction.Nature nature, Criterion... criterion)
-
-
Method Detail
-
add
public Junction add(Criterion criterion)
Adds a criterion to the junction (and/or)- Parameters:
criterion- The criterion to add- Returns:
this, for method chaining
-
getNature
public Junction.Nature getNature()
-
conditions
public java.lang.Iterable<Criterion> conditions()
Access the conditions making up the junction- Returns:
- the criterion
-
getTypedValues
public TypedValue[] getTypedValues(Criteria crit, CriteriaQuery criteriaQuery) throws HibernateException
Description copied from interface:CriterionReturn typed values for all parameters in the rendered SQL fragment- Specified by:
getTypedValuesin interfaceCriterion- Parameters:
crit- The local criteriacriteriaQuery- The overall criteria query- Returns:
- The types values (for binding)
- Throws:
HibernateException- Problem determining types.
-
toSqlString
public java.lang.String toSqlString(Criteria crit, CriteriaQuery criteriaQuery) throws HibernateException
Description copied from interface:CriterionRender the SQL fragment- Specified by:
toSqlStringin interfaceCriterion- Parameters:
crit- The local criteriacriteriaQuery- The overall criteria query- Returns:
- The generated SQL fragment
- Throws:
HibernateException- Problem during rendering.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-