- All Known Implementing Classes:
DefaultQueryBuilderProviderImpl
QueryBuilderProvider relies on preview features of the Java platform:
QueryBuilderProviderrefers 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.
Provides pluggable query builder logic.
- Since:
- 1.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface st.orm.spi.Orderable
Orderable.After, Orderable.AfterAny, Orderable.Before, Orderable.BeforeAny -
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.
-
Method Details
-
selectFrom
<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.- 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, 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.- 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,?, 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.- 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.
-
QueryBuilderProviderwhen preview features are enabled.