- All Known Subinterfaces:
ORMTemplate,QueryTemplate
- All Known Implementing Classes:
ORMTemplateImpl,QueryBuilder.WhereBuilder
public interface SubqueryTemplate
SubqueryTemplate relies on preview features of the Java platform:
SubqueryTemplaterefers 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.
The subquery template is used to construct subqueries that can be linked to the outer query.
Unlike regular queries, subqueries only select fields from the primary table; fields from nested (foreign key) records are not included. Additionally, subqueries cannot be directly built — they should be passed as a query builder object when constructing the outer query.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Record>
QueryBuilder<T, ?, ?> Create a subquery for the given table.default <T extends Record,R extends Record>
QueryBuilder<T, ?, ?> Crate a subquery for the given table and select type.<T extends Record>
QueryBuilder<T, ?, ?> subquery(Class<T> fromType, StringTemplatePREVIEW template) Create a subquery for the given table and select type using the giventemplate.
-
Method Details
-
subquery
Create a subquery for the given table.- Type Parameters:
T- the table type to select from.- Parameters:
fromType- the table to create the subquery for.- Returns:
- the subquery builder.
-
subquery
default <T extends Record,R extends Record> QueryBuilder<T,?, subquery?> (@Nonnull Class<T> fromType, @Nonnull Class<R> selectType) Crate a subquery for the given table and select type.- Type Parameters:
T- the table type to select from.R- the result type.- Parameters:
fromType- the table to create the subquery for.selectType- the type to select.- Returns:
- the subquery builder.
-
subquery
<T extends Record> QueryBuilder<T,?, subquery?> (@Nonnull Class<T> fromType, @Nonnull StringTemplatePREVIEW template) Create a subquery for the given table and select type using the giventemplate.- Type Parameters:
T- the table type to select from.- Parameters:
fromType- the table to create the subquery for.template- the select clause template.- Returns:
- the subquery builder.
-
SubqueryTemplatewhen preview features are enabled.