Class JoinedSelect<T extends org.tentackle.pdo.PersistentDomainObject<T>>

  • Type Parameters:
    T - the primary PDO type

    public class JoinedSelect<T extends org.tentackle.pdo.PersistentDomainObject<T>>
    extends java.lang.Object
    A 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.
      void createJoinedSql​(T pdo, java.lang.StringBuilder selectSql)
      Creates the SQL-code that does the joined select.
      T currentPdo()
      Gets the currentl retrieved PDO.
      java.util.List<Join<? super T,​?>> getJoins()
      Gets the joins.
      T getLastPdo()
      Gets the PDO retrieved before the current PDO.
      void initialize​(java.util.List<T> list)
      Initializes the joined select.
      T nextPdo​(T pdo)
      Finishes the current pdo and switches to the next.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JoinedSelect

        public JoinedSelect()
        Creates a joined select.
      • JoinedSelect

        public JoinedSelect​(java.util.List<Join<? super T,​?>> joins)
        Creates a joined select from a list of joins.
        Parameters:
        joins - the joins
    • 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)
      • getJoins

        public java.util.List<Join<? super T,​?>> getJoins()
        Gets the joins.
        Returns:
        the joins
      • createJoinedSql

        public void createJoinedSql​(T pdo,
                                    java.lang.StringBuilder selectSql)
        Creates the SQL-code that does the joined select.
        Parameters:
        pdo - the pdo proxy
        selectSql - 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