类 JoinSequence
- java.lang.Object
-
- org.hibernate.engine.internal.JoinSequence
-
public class JoinSequence extends Object
A sequence ofJoinSequence.Joindelegates to make it "easier" to work with joins. The "easier" part is obviously subjective ;) Additionally JoinSequence is a directed graph of other JoinSequence instances, as represented by thenext(setNext(JoinSequence)) pointer.- 作者:
- Gavin King, Steve Ebersole
- 另请参阅:
JoinFragment
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classJoinSequence.JoinRepresents a joinstatic interfaceJoinSequence.SelectorA subclass join selector
-
构造器概要
构造器 构造器 说明 JoinSequence(SessionFactoryImplementor factory)Constructs a JoinSequence
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 JoinSequenceaddCondition(String condition)Add a condition to this sequence.JoinSequenceaddCondition(String alias, String[] columns, String condition)Add a condition to this sequence.JoinSequenceaddJoin(ImpliedFromElement fromElement)Embeds an implied from element into this sequenceJoinSequenceaddJoin(AssociationType associationType, String alias, JoinType joinType, String[] referencingKey)Add a join to this sequenceJoinSequenceaddJoin(AssociationType associationType, String alias, JoinType joinType, String[][] referencingKeys)Add a join to this sequencevoidapplyTreatAsDeclarations(Set<String> treatAsDeclarations)JoinSequencecopy()Create a full, although shallow, copy.JoinSequencecopyForCollectionProperty()JoinSequence.JoingetFirstJoin()JoinSequencegetFromPart()Retrieve a JoinSequence that represents just the FROM clause partsprotected Set<String>getTreatAsDeclarations()protected booleanisIncluded(String alias)booleanisThetaStyle()JoinSequencesetNext(JoinSequence next)Sets the next join sequencevoidsetQueryReferencedTables(Set<String> queryReferencedTables)Set all tables the query refers to.JoinSequencesetRoot(Joinable joinable, String alias)Set the root of this JoinSequence.JoinSequencesetSelector(JoinSequence.Selector selector)Set the Selector to use to determine how subclass joins should be applied.JoinSequencesetUseThetaStyle(boolean useThetaStyle)Should this JoinSequence use theta-style joining (both a FROM and WHERE component) in the rendered SQL?JoinFragmenttoJoinFragment()Generate a JoinFragmentJoinFragmenttoJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins)Generate a JoinFragmentJoinFragmenttoJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins, boolean renderSubclassJoins, String withClauseFragment)JoinFragmenttoJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins, String withClauseFragment)Generate a JoinFragmentStringtoString()
-
-
-
构造器详细资料
-
JoinSequence
public JoinSequence(SessionFactoryImplementor factory)
Constructs a JoinSequence- 参数:
factory- The SessionFactory
-
-
方法详细资料
-
getFromPart
public JoinSequence getFromPart()
Retrieve a JoinSequence that represents just the FROM clause parts- 返回:
- The JoinSequence that represents just the FROM clause parts
-
copy
public JoinSequence copy()
Create a full, although shallow, copy.- 返回:
- The copy
-
addJoin
public JoinSequence addJoin(AssociationType associationType, String alias, JoinType joinType, String[] referencingKey) throws MappingException
Add a join to this sequence- 参数:
associationType- The type of the association representing the joinalias- The RHS alias for the joinjoinType- The type of join (INNER, etc)referencingKey- The LHS columns for the join condition- 返回:
- The Join memento
- 抛出:
MappingException- Generally indicates a problem resolving the associationType to aJoinable
-
addJoin
public JoinSequence addJoin(AssociationType associationType, String alias, JoinType joinType, String[][] referencingKeys) throws MappingException
Add a join to this sequence- 参数:
associationType- The type of the association representing the joinalias- The RHS alias for the joinjoinType- The type of join (INNER, etc)referencingKeys- The LHS columns for the join condition- 返回:
- The Join memento
- 抛出:
MappingException- Generally indicates a problem resolving the associationType to aJoinable
-
addJoin
public JoinSequence addJoin(ImpliedFromElement fromElement)
Embeds an implied from element into this sequence- 参数:
fromElement- The implied from element to embed- 返回:
- The Join memento
-
toJoinFragment
public JoinFragment toJoinFragment() throws MappingException
Generate a JoinFragment- 返回:
- The JoinFragment
- 抛出:
MappingException- Indicates a problem access the provided metadata, or incorrect metadata
-
toJoinFragment
public JoinFragment toJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins) throws MappingException
Generate a JoinFragment- 参数:
enabledFilters- The filters associated with the originating session to properly define join conditionsincludeAllSubclassJoins- Should all subclass joins be added to the rendered JoinFragment?- 返回:
- The JoinFragment
- 抛出:
MappingException- Indicates a problem access the provided metadata, or incorrect metadata
-
toJoinFragment
public JoinFragment toJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins, String withClauseFragment) throws MappingException
Generate a JoinFragment- 参数:
enabledFilters- The filters associated with the originating session to properly define join conditionsincludeAllSubclassJoins- Should all subclass joins be added to the rendered JoinFragment?withClauseFragment- The with clause (which represents additional join restrictions) fragment- 返回:
- The JoinFragment
- 抛出:
MappingException- Indicates a problem access the provided metadata, or incorrect metadata
-
toJoinFragment
public JoinFragment toJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins, boolean renderSubclassJoins, String withClauseFragment) throws MappingException
- 抛出:
MappingException
-
isIncluded
protected boolean isIncluded(String alias)
-
addCondition
public JoinSequence addCondition(String condition)
Add a condition to this sequence.- 参数:
condition- The condition- 返回:
- {@link this}, for method chaining
-
addCondition
public JoinSequence addCondition(String alias, String[] columns, String condition)
Add a condition to this sequence. Typical usage here might be:addCondition( "a", {"c1", "c2"}, "?" )to represent:"... a.c1 = ? and a.c2 = ? ..."- 参数:
alias- The alias to apply to the columnscolumns- The columns to add checks forcondition- The conditions to check against the columns- 返回:
- {@link this}, for method chaining
-
setRoot
public JoinSequence setRoot(Joinable joinable, String alias)
Set the root of this JoinSequence. In SQL terms, this would be the driving table.- 参数:
joinable- The entity/collection that is the root of this JoinSequencealias- The alias associated with that joinable.- 返回:
- {@link this}, for method chaining
-
setNext
public JoinSequence setNext(JoinSequence next)
Sets the next join sequence- 参数:
next- The next JoinSequence in the directed graph- 返回:
this, for method chaining
-
setSelector
public JoinSequence setSelector(JoinSequence.Selector selector)
Set the Selector to use to determine how subclass joins should be applied.- 参数:
selector- The selector to apply- 返回:
this, for method chaining
-
setUseThetaStyle
public JoinSequence setUseThetaStyle(boolean useThetaStyle)
Should this JoinSequence use theta-style joining (both a FROM and WHERE component) in the rendered SQL?- 参数:
useThetaStyle-trueindicates that theta-style joins should be used.- 返回:
this, for method chaining
-
isThetaStyle
public boolean isThetaStyle()
-
setQueryReferencedTables
public void setQueryReferencedTables(Set<String> queryReferencedTables)
Set all tables the query refers to. It allows to optimize the query.- 参数:
queryReferencedTables-
-
getFirstJoin
public JoinSequence.Join getFirstJoin()
-
copyForCollectionProperty
public JoinSequence copyForCollectionProperty()
-
-