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(org.tentackle.sql.JoinType type,
String columnName,
String joinedColumnName,
Class<J> joinedClass,
String joinAlias,
BiConsumer<T,J> joiner)
Creates a join.
|
Join(org.tentackle.sql.JoinType type,
String columnName,
String joinedColumnName,
Class<J> joinedClass,
String joinAlias,
String extraSql,
BiConsumer<T,J> joiner)
Creates a join.
|
| Modifier and Type | Method and Description |
|---|---|
Join<T,J> |
addJoin(Join<J,?> join)
Adds a cascaded join.
|
J |
createJoinedPdo(T pdo)
Creates a new PDO to join to given pdo.
|
String |
getColumnName()
Gets the column name of the PDO.
|
String |
getExtraSql()
Gets optional SQL code.
|
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.
|
List<Join<J,?>> |
getJoins()
Gets the cascaded joins.
|
org.tentackle.sql.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.
|
public Join(org.tentackle.sql.JoinType type,
String columnName,
String joinedColumnName,
Class<J> joinedClass,
String joinAlias,
String extraSql,
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 pdoextraSql - optional SQL code (usually a WHERE clause)joiner - the joinerpublic Join(org.tentackle.sql.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 org.tentackle.sql.JoinType getType()
public boolean isListJoin()
public boolean isExplicitIdAliasRequired()
public String getColumnName()
public String getJoinedColumnName()
public String getJoinAlias()
public BiConsumer<T,J> getJoiner()
public String getExtraSql()
public Join<T,J> addJoin(Join<J,?> join)
join - the cascaded joinpublic List<Join<J,?>> getJoins()
public void initialize()
public J createJoinedPdo(T pdo)
pdo - the pdo to join toTentackle - distributed, domain- and model-driven