public class JoinSequence extends Object
JoinSequence.Join
delegates 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 the
next
(setNext(JoinSequence)
) pointer.JoinFragment
Modifier and Type | Class and Description |
---|---|
static class |
JoinSequence.Join
Represents a join
|
static interface |
JoinSequence.Selector
A subclass join selector
|
Constructor and Description |
---|
JoinSequence(SessionFactoryImplementor factory)
Constructs a JoinSequence
|
Modifier and Type | Method and Description |
---|---|
JoinSequence |
addCondition(String condition)
Add a condition to this sequence.
|
JoinSequence |
addCondition(String alias,
String[] columns,
String condition)
Add a condition to this sequence.
|
JoinSequence |
addJoin(AssociationType associationType,
String alias,
JoinType joinType,
String[] referencingKey)
Add a join to this sequence
|
void |
applyTreatAsDeclarations(Set<String> treatAsDeclarations) |
JoinSequence |
copy()
Create a full, although shallow, copy.
|
JoinSequence.Join |
getFirstJoin() |
JoinSequence |
getFromPart()
Retrieve a JoinSequence that represents just the FROM clause parts
|
protected Set<String> |
getTreatAsDeclarations() |
protected boolean |
isIncluded(String alias) |
boolean |
isThetaStyle() |
JoinSequence |
setNext(JoinSequence next)
Sets the next join sequence
|
JoinSequence |
setRoot(Joinable joinable,
String alias)
Set the root of this JoinSequence.
|
JoinSequence |
setSelector(JoinSequence.Selector selector)
Set the Selector to use to determine how subclass joins should be applied.
|
JoinSequence |
setUseThetaStyle(boolean useThetaStyle)
Should this JoinSequence use theta-style joining (both a FROM and WHERE component) in the rendered SQL?
|
JoinFragment |
toJoinFragment()
Generate a JoinFragment
|
JoinFragment |
toJoinFragment(Map enabledFilters,
boolean includeAllSubclassJoins)
Generate a JoinFragment
|
JoinFragment |
toJoinFragment(Map enabledFilters,
boolean includeAllSubclassJoins,
String withClauseFragment,
String withClauseJoinAlias)
Generate a JoinFragment
|
String |
toString() |
public JoinSequence(SessionFactoryImplementor factory)
factory
- The SessionFactorypublic JoinSequence getFromPart()
public JoinSequence copy()
public JoinSequence addJoin(AssociationType associationType, String alias, JoinType joinType, String[] referencingKey) throws MappingException
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 conditionMappingException
- Generally indicates a problem resolving the associationType to a Joinable
public JoinFragment toJoinFragment() throws MappingException
MappingException
- Indicates a problem access the provided metadata, or incorrect metadatapublic JoinFragment toJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins) throws MappingException
enabledFilters
- The filters associated with the originating session to properly define join conditionsincludeAllSubclassJoins
- Should all subclass joins be added to the rendered JoinFragment?MappingException
- Indicates a problem access the provided metadata, or incorrect metadatapublic JoinFragment toJoinFragment(Map enabledFilters, boolean includeAllSubclassJoins, String withClauseFragment, String withClauseJoinAlias) throws MappingException
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) fragmentwithClauseJoinAlias
- TheMappingException
- Indicates a problem access the provided metadata, or incorrect metadataprotected boolean isIncluded(String alias)
public JoinSequence addCondition(String condition)
condition
- The conditionthis
, for method chainingpublic JoinSequence addCondition(String alias, String[] columns, String condition)
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 columnsthis
, for method chainingpublic JoinSequence setRoot(Joinable joinable, String alias)
joinable
- The entity/collection that is the root of this JoinSequencealias
- The alias associated with that joinable.this
, for method chainingpublic JoinSequence setNext(JoinSequence next)
next
- The next JoinSequence in the directed graphthis
, for method chainingpublic JoinSequence setSelector(JoinSequence.Selector selector)
selector
- The selector to applythis
, for method chainingpublic JoinSequence setUseThetaStyle(boolean useThetaStyle)
useThetaStyle
- true
indicates that theta-style joins should be used.this
, for method chainingpublic boolean isThetaStyle()
public JoinSequence.Join getFirstJoin()
Copyright © 2017 JBoss by Red Hat. All rights reserved.