Top Description Inners Fields Constructors Methods
org.hibernate.criterion

public Class Junction

extends Object
implements Criterion
Class Inheritance
All Implemented Interfaces
org.hibernate.criterion.Criterion, java.io.Serializable
Known Direct Subclasses
org.hibernate.criterion.Conjunction, org.hibernate.criterion.Disjunction
Imports
java.util.ArrayList, .Collections, .Iterator, .List, .Locale, org.hibernate.Criteria, .HibernateException, org.hibernate.engine.spi.TypedValue, org.hibernate.internal.util.StringHelper

A sequence of a logical expressions combined by some associative logical operator
Authors
Gavin King, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Junction.Nature

The type of junction

Field Summary

Modifier and TypeField and Description
private final List<Criterion>
private final Junction.Nature

Constructor Summary

AccessConstructor and Description
protected
protected
Junction(Junction.Nature nature, Criterion... criterion)

Method Summary

Modifier and TypeMethod and Description
public Junction

Returns:

this, for method chaining
add
(Criterion
The criterion to add
criterion
)

Adds a criterion to the junction (and/or)

public Iterable<Criterion>

Returns:

the criterion
conditions
()

Access the conditions making up the junction

public Junction.Nature
public TypedValue[]
getTypedValues(Criteria
The local criteria
crit
,
CriteriaQuery
The overall criteria query
criteriaQuery
)

Implements org.hibernate.criterion.Criterion.getTypedValues.

Return typed values for all parameters in the rendered SQL fragment
public String
toSqlString(Criteria
The local criteria
crit
,
CriteriaQuery
The overall criteria query
criteriaQuery
)

Implements org.hibernate.criterion.Criterion.toSqlString.

Render the SQL fragment
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

conditionsback to summary
private final List<Criterion> conditions
natureback to summary
private final Junction.Nature nature

Constructor Detail

Junctionback to summary
protected Junction(Junction.Nature nature)
Junctionback to summary
protected Junction(Junction.Nature nature, Criterion... criterion)

Method Detail

addback to summary
public Junction add(Criterion criterion)

Adds a criterion to the junction (and/or)

Parameters
criterion:Criterion

The criterion to add

Returns:Junction

this, for method chaining

conditionsback to summary
public Iterable<Criterion> conditions()

Access the conditions making up the junction

Returns:Iterable<Criterion>

the criterion

getNatureback to summary
public Junction.Nature getNature()
getTypedValuesback to summary
public TypedValue[] getTypedValues(Criteria crit, CriteriaQuery criteriaQuery) throws HibernateException

Implements org.hibernate.criterion.Criterion.getTypedValues.

Doc from org.hibernate.criterion.Criterion.getTypedValues.

Return typed values for all parameters in the rendered SQL fragment

Parameters
crit:Criteria

The local criteria

criteriaQuery:CriteriaQuery

The overall criteria query

Returns:TypedValue[]

The types values (for binding)

Annotations
@Override
Exceptions
HibernateException:
Problem determining types.
toSqlStringback to summary
public String toSqlString(Criteria crit, CriteriaQuery criteriaQuery) throws HibernateException

Implements org.hibernate.criterion.Criterion.toSqlString.

Doc from org.hibernate.criterion.Criterion.toSqlString.

Render the SQL fragment

Parameters
crit:Criteria

The local criteria

criteriaQuery:CriteriaQuery

The overall criteria query

Returns:String

The generated SQL fragment

Annotations
@Override
Exceptions
HibernateException:
Problem during rendering.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.hibernate.criterion back to summary

public final Enum Junction.Nature

extends Enum<Junction.Nature>
Class Inheritance

The type of junction

Field Summary

Modifier and TypeField and Description
public static final Junction.Nature
AND

An AND

public static final Junction.Nature
OR

An OR

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

SQL operator
getOperator
()

The corresponding SQL operator

public static Junction.Nature
public static Junction.Nature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANDback to summary
public static final Junction.Nature AND

An AND

ORback to summary
public static final Junction.Nature OR

An OR

Constructor Detail

Natureback to summary
private Nature()

Method Detail

getOperatorback to summary
public String getOperator()

The corresponding SQL operator

Returns:String

SQL operator

valueOfback to summary
public static Junction.Nature valueOf(String name)
valuesback to summary
public static Junction.Nature[] values()