T - the PDO type holding the relation to the joined PDOJ - the joined PDO typepublic class Join<T extends PersistentDomainObject<T>,J extends PersistentDomainObject<J>> extends Object
Joins two PDOs within the same select.
Used by eager joins and explicit domain-driven joins.
Works for composite and non-composite relations.
| Constructor and Description |
|---|
Join(JoinType type,
String columnName,
String joinedColumnName,
Class<J> joinedClass,
String joinAlias,
BiConsumer<T,J> joiner)
Creates a join.
|
| Modifier and Type | Method and Description |
|---|---|
J |
createJoinedPdo(T pdo)
Creates a new PDO to join to given pdo.
|
String |
getColumnName()
Gets the column name of the PDO.
|
String |
getJoinAlias()
Gets the alias of the joined PDO.
|
Class<J> |
getJoinedClass()
Gets the joined PDO class.
|
String |
getJoinedColumnName()
Gets the joined column name.
|
BiConsumer<T,J> |
getJoiner()
Gets the joiner.
|
J |
getLastJoinedPdo()
Gets the last PDO joined to the last PDO.
|
JoinType |
getType()
Gets the join type.
|
void |
initialize()
Initializes the join.
|
boolean |
isExplicitIdAliasRequired()
Returne whether an extra ID-alias must be added to the joined select statement.
|
boolean |
isListJoin()
Returns whether joined to list or object.
|
void |
join(T pdo,
J pdoToJoin)
Joins a pdo with another pdo.
The last joined pdo is remembered and can be retrieved via getLastJoinedPdo(). |
public Join(JoinType type, String columnName, String joinedColumnName, Class<J> joinedClass, String joinAlias, BiConsumer<T,J> joiner)
type - the join typecolumnName - the column name of the PDO (includung table alias!)joinedColumnName - the column name of the joined PDO (includung table alias!)joinedClass - the joined classjoinAlias - the alias of the joined pdojoiner - the joinerpublic JoinType getType()
public boolean isListJoin()
public boolean isExplicitIdAliasRequired()
public String getColumnName()
public String getJoinedColumnName()
public String getJoinAlias()
public BiConsumer<T,J> getJoiner()
public void initialize()
public J createJoinedPdo(T pdo)
pdo - the pdo to join topublic void join(T pdo, J pdoToJoin)
getLastJoinedPdo().pdo - the pdo, null if nonepdoToJoin - the pdo to join, null to finish the joining processpublic J getLastJoinedPdo()
Copyright © 2016 Krake Softwaretechnik. All rights reserved.