java.lang.Object
st.orm.spi.DefaultQueryBuilderProviderImpl
- All Implemented Interfaces:
Orderable<Provider>,Provider,QueryBuilderProvider
DefaultQueryBuilderProviderImpl relies on preview features of the Java platform:
DefaultQueryBuilderProviderImplrefers to one or more preview APIs:StringTemplate.
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface st.orm.spi.Orderable
Orderable.After, Orderable.AfterAny, Orderable.Before, Orderable.BeforeAny -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Record,ID>
QueryBuilder<T, ?, ID> deleteFrom(QueryTemplate queryTemplate, Class<T> fromType, Supplier<Model<T, ID>> modelSupplier) Creates a query builder for the specified table to delete from.<T extends Record,R, ID>
QueryBuilder<T, R, ID> selectFrom(QueryTemplate queryTemplate, Class<T> fromType, Class<R> selectType, StringTemplatePREVIEW template, boolean subquery, Supplier<Model<T, ID>> modelSupplier) Creates a query builder for the specified table and select type using the giventemplate.<T extends Record,R extends Record, ID>
QueryBuilder<T, Ref<R>, ID> selectRefFrom(QueryTemplate queryTemplate, Class<T> fromType, Class<R> refType, Class<?> pkType, Supplier<Model<T, ID>> modelSupplier) Creates a query builder for the specified table and select type using the giventemplate.
-
Constructor Details
-
DefaultQueryBuilderProviderImpl
public DefaultQueryBuilderProviderImpl()
-
-
Method Details
-
selectFrom
public <T extends Record,R, QueryBuilder<T,ID> R, selectFromID> (@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 giventemplate.- Specified by:
selectFromin interfaceQueryBuilderProvider- 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, QueryBuilder<T,ID> Ref<R>, selectRefFromID> (@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 giventemplate.- Specified by:
selectRefFromin interfaceQueryBuilderProvider- 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,?, deleteFromID> (@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:
deleteFromin interfaceQueryBuilderProvider- 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.
-
DefaultQueryBuilderProviderImplwhen preview features are enabled.