java.lang.Object
st.orm.template.impl.PreparedStatementTemplateImpl
- All Implemented Interfaces:
QueryFactory,PreparedStatementTemplate
public final class PreparedStatementTemplateImpl
extends Object
implements PreparedStatementTemplate, QueryFactory
PreparedStatementTemplateImpl relies on preview features of the Java platform:
PreparedStatementTemplateImplrefers 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.
-
Constructor Summary
ConstructorsConstructorDescriptionPreparedStatementTemplateImpl(Connection connection) PreparedStatementTemplateImpl(DataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptioncreate(StringTemplatePREVIEW template) Create a new query for the specifiedtemplate.Create a new bind variables instance that can be used to add bind variables to a batch.query(StringTemplatePREVIEW template) Creates a query for the specified querytemplate.toORM()Returns an ORM template that is backed by this prepared statement template.withColumnNameResolver(ColumnNameResolver columnNameResolver) Returns a new prepared statement template with the specified column name resolver.withForeignKeyResolver(ForeignKeyResolver foreignKeyResolver) Returns a new prepared statement template with the specified foreign key resolver.withProviderFilter(Predicate<Provider> providerFilter) Returns a new prepared statement template with the specified provider filter.withTableAliasResolver(TableAliasResolver tableAliasResolver) Returns a new prepared statement template with the specified table alias resolver.withTableNameResolver(TableNameResolver tableNameResolver) Returns a new prepared statement template with the specified table name resolver.
-
Constructor Details
-
PreparedStatementTemplateImpl
-
PreparedStatementTemplateImpl
-
-
Method Details
-
withTableNameResolver
public PreparedStatementTemplateImpl withTableNameResolver(@Nullable TableNameResolver tableNameResolver) Returns a new prepared statement template with the specified table name resolver.- Specified by:
withTableNameResolverin interfacePreparedStatementTemplate- Parameters:
tableNameResolver- the table name resolver.- Returns:
- a new prepared statement template.
-
withColumnNameResolver
public PreparedStatementTemplateImpl withColumnNameResolver(@Nullable ColumnNameResolver columnNameResolver) Returns a new prepared statement template with the specified column name resolver.- Specified by:
withColumnNameResolverin interfacePreparedStatementTemplate- Parameters:
columnNameResolver- the column name resolver.- Returns:
- a new prepared statement template.
-
withForeignKeyResolver
public PreparedStatementTemplateImpl withForeignKeyResolver(@Nullable ForeignKeyResolver foreignKeyResolver) Returns a new prepared statement template with the specified foreign key resolver.- Specified by:
withForeignKeyResolverin interfacePreparedStatementTemplate- Parameters:
foreignKeyResolver- the foreign key resolver.- Returns:
- a new prepared statement template.
-
withTableAliasResolver
public PreparedStatementTemplate withTableAliasResolver(@Nonnull TableAliasResolver tableAliasResolver) Returns a new prepared statement template with the specified table alias resolver.- Specified by:
withTableAliasResolverin interfacePreparedStatementTemplate- Parameters:
tableAliasResolver- the table alias resolver.- Returns:
- a new prepared statement template.
-
withProviderFilter
public PreparedStatementTemplateImpl withProviderFilter(@Nullable Predicate<Provider> providerFilter) Returns a new prepared statement template with the specified provider filter.- Specified by:
withProviderFilterin interfacePreparedStatementTemplate- Parameters:
providerFilter- the provider filter.- Returns:
- a new prepared statement template.
-
createBindVars
Create a new bind variables instance that can be used to add bind variables to a batch.- Specified by:
createBindVarsin interfacePreparedStatementTemplate- Specified by:
createBindVarsin interfaceQueryFactory- Returns:
- a new bind variables instance.
-
toORM
Returns an ORM template that is backed by this prepared statement template.- Specified by:
toORMin interfacePreparedStatementTemplate- Returns:
- the ORM template.
-
create
Create a new query for the specifiedtemplate.- Specified by:
createin interfaceQueryFactory- Parameters:
template- the template to process.- Returns:
- a query that can be executed.
- Throws:
PersistenceException- if the template is invalid.
-
query
Creates a query for the specified querytemplate.- Specified by:
queryin interfacePreparedStatementTemplate- Parameters:
template- the query template.- Returns:
- the query.
- Throws:
SQLException
-
PreparedStatementTemplateImplwhen preview features are enabled.