Module org.tentackle.persistence
Package org.tentackle.persist
Class JoinedSelect<T extends PersistentDomainObject<T>>
- java.lang.Object
-
- org.tentackle.persist.JoinedSelect<T>
-
- Type Parameters:
T- the primary PDO type
public class JoinedSelect<T extends PersistentDomainObject<T>> extends Object
A joined select.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description JoinedSelect()Creates a joined select.JoinedSelect(List<Join<? super T,?>> joins)Creates a joined select from a list of joins.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoinedSelect<T>addJoin(Join<? super T,?> join)Adds a join.voidcreateJoinedSql(T pdo, StringBuilder selectSql)Creates the SQL-code that does the joined select.TcurrentPdo()Gets the currentl retrieved PDO.List<Join<? super T,?>>getJoins()Gets the joins.TgetLastPdo()Gets the PDO retrieved before the current PDO.voidinitialize(List<T> list)Initializes the joined select.TnextPdo(T pdo)Finishes the current pdo and switches to the next.
-
-
-
Method Detail
-
addJoin
public JoinedSelect<T> addJoin(Join<? super T,?> join)
Adds a join.- Parameters:
join- the join- Returns:
- me (to allow fluent style setup)
-
createJoinedSql
public void createJoinedSql(T pdo, StringBuilder selectSql)
Creates the SQL-code that does the joined select.- Parameters:
pdo- the pdo proxyselectSql- the unjoined select builder
-
getLastPdo
public T getLastPdo()
Gets the PDO retrieved before the current PDO.- Returns:
- the last pdo
-
currentPdo
public T currentPdo()
Gets the currentl retrieved PDO.- Returns:
- the pdo, null if no query running
-
nextPdo
public T nextPdo(T pdo)
Finishes the current pdo and switches to the next.- Parameters:
pdo- the next pdo- Returns:
- the pdo possibly changed if already in list
-
-