Module org.tentackle.persistence
Package org.tentackle.persist
Class JoinedSelect<T extends org.tentackle.pdo.PersistentDomainObject<T>>
- java.lang.Object
-
- org.tentackle.persist.JoinedSelect<T>
-
- Type Parameters:
T- the primary PDO type
public class JoinedSelect<T extends org.tentackle.pdo.PersistentDomainObject<T>> extends java.lang.ObjectA joined select.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description JoinedSelect()Creates a joined select.JoinedSelect(java.util.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, java.lang.StringBuilder selectSql)Creates the SQL-code that does the joined select.TcurrentPdo()Gets the currentl retrieved PDO.java.util.List<Join<? super T,?>>getJoins()Gets the joins.TgetLastPdo()Gets the PDO retrieved before the current PDO.voidinitialize(java.util.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, java.lang.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
-
initialize
public void initialize(java.util.List<T> list)
Initializes the joined select.- Parameters:
list- the list if select to list
-
-