Module storm
Package st.orm.spi

Interface QueryBuilderProvider

All Superinterfaces:
Orderable<Provider>, Provider
All Known Implementing Classes:
DefaultQueryBuilderProviderImpl

public interface QueryBuilderProvider extends Provider
QueryBuilderProvider relies on preview features of the Java platform:
  • QueryBuilderProvider refers to one or more preview APIs: StringTemplate.
Programs can only use QueryBuilderProvider when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Provides pluggable query builder logic.
Since:
1.1
  • Method Details

    • selectFrom

      <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.
      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

      <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.
      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

      <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.
      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.