Interface SelectObjectBuilder<T extends FullQueryBuilder<?,T>>

Type Parameters:
T - The query builder that is returned on terminal operations

public interface SelectObjectBuilder<T extends FullQueryBuilder<?,T>>
The builder interface for a select new select clause.
Since:
1.0.0
Author:
Christian Beikov
  • Method Details

    • withSubquery

      Like withSubquery(java.lang.String) but without an alias.
      Returns:
      The subquery initiator for building a subquery
    • withSubquery

      Starts a subquery builder which allows the result of the specified subquery to be passed as argument to the select new clause.
      Parameters:
      alias - The alias for the subquery
      Returns:
      A starting point for the subquery specification
    • withSubquery

      SubqueryInitiator<SelectObjectBuilder<T>> withSubquery(String subqueryAlias, String expression, String selectAlias)
      Starts a SubqueryInitiator for a new argument for the select new clause with the given select alias.

      All occurrences of subqueryAlias in expression will be replaced by the subquery. When the builder finishes, the select item is added to the parent container represented by the type X.

      Parameters:
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item. This expression contains the subqueryAlias to define the insertion points for the subquery.
      selectAlias - The select alias for the expression
      Returns:
      The subquery initiator for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryInitiator<SelectObjectBuilder<T>> withSubquery(String subqueryAlias, String expression)
      Parameters:
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item
      Returns:
      The subquery initiator for building a subquery
      Since:
      1.2.0
    • withSubqueries

      MultipleSubqueryInitiator<SelectObjectBuilder<T>> withSubqueries(String expression, String selectAlias)
      Starts a MultipleSubqueryInitiator for a new argument for the select new clause with the given select alias.

      All occurrences of subsequently defined subqueryAliases in expression will be replaced by the respective subquery. When the builder finishes, the select item is added to the parent container represented by the type X.

      Parameters:
      expression - The expression which will be added as select item. This expression contains the subqueryAlias to define the insertion points for the subquery.
      selectAlias - The select alias for the expression
      Returns:
      The subquery initiator for building multiple subqueries for their respective subqueryAliases
      Since:
      1.2.0
    • withSubqueries

      MultipleSubqueryInitiator<SelectObjectBuilder<T>> withSubqueries(String expression)
      Parameters:
      expression - The expression which will be added as select item
      Returns:
      The subquery initiator for building multiple subqueries for their respective subqueryAliases
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(FullQueryBuilder<?,?> criteriaBuilder)
      Parameters:
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(String alias, FullQueryBuilder<?,?> criteriaBuilder)
      Starts a SubqueryBuilder based on the given criteria builder which allows the result of the specified subquery to be passed as argument to the select new clause.
      Parameters:
      alias - The alias for the subquery
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(String subqueryAlias, String expression, String selectAlias, FullQueryBuilder<?,?> criteriaBuilder)
      Starts a SubqueryBuilder based on the given criteria builder for a new argument for the select new clause with the given select alias.

      All occurrences of subqueryAlias in expression will be replaced by the subquery. When the builder finishes, the select item is added to the parent container represented by the type X.

      Parameters:
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item. This expression contains the subqueryAlias to define the insertion points for the subquery.
      selectAlias - The select alias for the expression
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(String subqueryAlias, String expression, FullQueryBuilder<?,?> criteriaBuilder)
      Parameters:
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • with

      SelectObjectBuilder<T> with(String expression)
      Like with(java.lang.String, java.lang.String) but without an alias.
      Parameters:
      expression - The expression to add
      Returns:
      A starting point for the subquery specification
    • with

      SelectObjectBuilder<T> with(String expression, String alias)
      Adds the given expression to the arguments for the select new select clause.
      Parameters:
      expression - The expression to add
      alias - The alias for the expression
      Returns:
      This select object builder
      Throws:
      IllegalStateException - Is thrown when the argument position is already taken
    • with

      SelectObjectBuilder<T> with(int position, String expression)
      Parameters:
      position - The position at which the expression should be added
      expression - The expression to add
      Returns:
      A starting point for the subquery specification
    • with

      SelectObjectBuilder<T> with(int position, String expression, String alias)
      Adds the given expression at the given position to the arguments for the select new select clause.
      Parameters:
      position - The position at which the expression should be added
      expression - The expression to add
      alias - The alias for the expression
      Returns:
      This select object builder
      Throws:
      IllegalStateException - Is thrown when the argument position is already taken
    • withSubquery

      SubqueryInitiator<SelectObjectBuilder<T>> withSubquery(int position)
      Like withSubquery(int,java.lang.String) but without an alias.
      Parameters:
      position - The position at which the expression should be added
      Returns:
      The subquery initiator for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryInitiator<SelectObjectBuilder<T>> withSubquery(int position, String alias)
      Like withSubquery(java.lang.String) but adds the resulting subquery expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      alias - The alias for the subquery
      Returns:
      The subquery initiator for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryInitiator<SelectObjectBuilder<T>> withSubquery(int position, String subqueryAlias, String expression, String selectAlias)
      Like withSubquery(java.lang.String,java.lang.String,java.lang.String) but adds the resulting subquery expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item.
      selectAlias - The select alias for the expression
      Returns:
      The subquery initiator for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryInitiator<SelectObjectBuilder<T>> withSubquery(int position, String subqueryAlias, String expression)
      Like withSubquery(java.lang.String,java.lang.String,java.lang.String) but adds the resulting subquery expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item.
      Returns:
      The subquery initiator for building a subquery
      Since:
      1.2.0
    • withSubqueries

      MultipleSubqueryInitiator<SelectObjectBuilder<T>> withSubqueries(int position, String expression, String selectAlias)
      Like withSubqueries(java.lang.String,java.lang.String) but adds the resulting expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      expression - The expression which will be added as select item.
      selectAlias - The select alias for the expression
      Returns:
      The subquery initiator for building multiple subqueries for their respective subqueryAliases
      Since:
      1.2.0
    • withSubqueries

      MultipleSubqueryInitiator<SelectObjectBuilder<T>> withSubqueries(int position, String expression)
      Parameters:
      position - The position at which the expression should be added
      expression - The expression which will be added as select item.
      Returns:
      The subquery initiator for building multiple subqueries for their respective subqueryAliases
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(int position, FullQueryBuilder<?,?> criteriaBuilder)
      Parameters:
      position - The position at which the expression should be added
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(int position, String alias, FullQueryBuilder<?,?> criteriaBuilder)
      Like withSubquery(java.lang.String,FullQueryBuilder) but adds the resulting subquery expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      alias - The alias for the subquery
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(int position, String subqueryAlias, String expression, String selectAlias, FullQueryBuilder<?,?> criteriaBuilder)
      Like withSubquery(java.lang.String,java.lang.String,java.lang.String,FullQueryBuilder) but adds the resulting subquery expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item.
      selectAlias - The select alias for the expression
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • withSubquery

      SubqueryBuilder<SelectObjectBuilder<T>> withSubquery(int position, String subqueryAlias, String expression, FullQueryBuilder<?,?> criteriaBuilder)
      Like withSubquery(java.lang.String,java.lang.String,java.lang.String,FullQueryBuilder) but adds the resulting subquery expression to the given position.
      Parameters:
      position - The position at which the expression should be added
      subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
      expression - The expression which will be added as select item.
      criteriaBuilder - The criteria builder to base the subquery on
      Returns:
      The subquery builder for building a subquery
      Since:
      1.2.0
    • end

      T end()
      Finishes the select object builder.
      Returns:
      The query builder