Class JoinedSelect<T extends PersistentDomainObject<T>>

  • Type Parameters:
    T - the primary PDO type

    public class JoinedSelect<T extends PersistentDomainObject<T>>
    extends Object
    A joined select.
    Author:
    harald
    • Constructor Detail

      • JoinedSelect

        public JoinedSelect()
        Creates a joined select.
      • JoinedSelect

        public JoinedSelect​(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 List<Join<? super T,​?>> getJoins()
        Gets the joins.
        Returns:
        the joins
      • createJoinedSql

        public void createJoinedSql​(T pdo,
                                    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​(List<T> list)
        Initializes the joined select.
        Parameters:
        list - the list if select to list