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 class
Junction.Nature
The type of junction
-
Constructor Summary
Constructors Modifier Constructor Description protected
Junction(Junction.Nature nature)
protected
Junction(Junction.Nature nature, Criterion... criterion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Junction
add(Criterion criterion)
Adds a criterion to the junction (and/or)java.lang.Iterable<Criterion>
conditions()
Access the conditions making up the junctionJunction.Nature
getNature()
TypedValue[]
getTypedValues(Criteria crit, CriteriaQuery criteriaQuery)
Return typed values for all parameters in the rendered SQL fragmentjava.lang.String
toSqlString(Criteria crit, CriteriaQuery criteriaQuery)
Render the SQL fragmentjava.lang.String
toString()
-
-
-
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:Criterion
Return typed values for all parameters in the rendered SQL fragment- Specified by:
getTypedValues
in interfaceCriterion
- Parameters:
crit
- The local criteriacriteriaQuery
- The overal 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:Criterion
Render the SQL fragment- Specified by:
toSqlString
in interfaceCriterion
- Parameters:
crit
- The local criteriacriteriaQuery
- The overal criteria query- Returns:
- The generated SQL fragment
- Throws:
HibernateException
- Problem during rendering.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-