Module storm
Package st.orm.spi

Class DefaultQueryBuilderProviderImpl

java.lang.Object
st.orm.spi.DefaultQueryBuilderProviderImpl
All Implemented Interfaces:
Orderable<Provider>, Provider, QueryBuilderProvider

public class DefaultQueryBuilderProviderImpl extends Object implements QueryBuilderProvider
DefaultQueryBuilderProviderImpl relies on preview features of the Java platform:
  • DefaultQueryBuilderProviderImpl refers to one or more preview APIs: StringTemplate.
Programs can only use DefaultQueryBuilderProviderImpl when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Default implementation of QueryBuilderProvider that are based on SelectBuilderImpl and DeleteBuilderImpl.
  • Constructor Details

    • DefaultQueryBuilderProviderImpl

      public DefaultQueryBuilderProviderImpl()
  • Method Details

    • selectFrom

      public <T extends Record, R, ID> QueryBuilder<T,R,ID> selectFrom(@Nonnull QueryTemplate queryTemplate, @Nonnull Class<T> fromType, @Nonnull Class<R> selectType, @Nonnull StringTemplatePREVIEW template, boolean subquery, @Nonnull Supplier<Model<T,ID>> modelSupplier)
      Creates a query builder for the specified table and select type using the given template.
      Specified by:
      selectFrom in interface QueryBuilderProvider
      Type Parameters:
      T - the table type to select from.
      R - the result type.
      Parameters:
      queryTemplate - provides the template logic for the query builder.
      fromType - the table to select from.
      selectType - the result type of the query.
      template - the select clause template.
      subquery - whether the query is a subquery.
      modelSupplier - a supplier that creates the model when needed.
      Returns:
      the query builder.
    • selectRefFrom

      public <T extends Record, R extends Record, ID> QueryBuilder<T,Ref<R>,ID> selectRefFrom(@Nonnull QueryTemplate queryTemplate, @Nonnull Class<T> fromType, @Nonnull Class<R> refType, @Nonnull Class<?> pkType, @Nonnull Supplier<Model<T,ID>> modelSupplier)
      Creates a query builder for the specified table and select type using the given template.
      Specified by:
      selectRefFrom in interface QueryBuilderProvider
      Type Parameters:
      T - the table type to select from.
      ID - the primary key type.
      Parameters:
      queryTemplate - provides the template logic for the query builder.
      fromType - the table to select from.
      refType - the type that is selected as ref.
      pkType - the primary key type of the table.
      modelSupplier - a supplier that creates the model when needed.
      Returns:
      the query builder.
    • deleteFrom

      public <T extends Record, ID> QueryBuilder<T,?,ID> deleteFrom(@Nonnull QueryTemplate queryTemplate, @Nonnull Class<T> fromType, @Nonnull Supplier<Model<T,ID>> modelSupplier)
      Creates a query builder for the specified table to delete from.
      Specified by:
      deleteFrom in interface QueryBuilderProvider
      Type Parameters:
      T - the table type to delete from.
      Parameters:
      queryTemplate - provides the template logic for the query builder.
      fromType - the table to delete from.
      modelSupplier - a supplier that creates the model when needed.
      Returns:
      the query builder.