Class JdbcParameterFactory
Creates JDBC parameter expressions for SQL AST translation without exposing Hibernate's concrete parameter implementations.
Use queryLimit(TypeConfiguration) and queryOffset(TypeConfiguration)
for pagination placeholders whose values come from the current query options
instead of ordinary JDBC parameter bindings.
Use custom(JdbcMapping, JdbcParameterBinder) when a provider-defined placeholder obtains its value
through a custom binder.
Every invocation creates a distinct parameter. When a parameter is rendered into a command, add its [JdbcParameter#getParameterBinder() parameter binder] at the corresponding placeholder position and retain the same parameter instance for any operation metadata which identifies that placeholder.
- Since:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic JdbcParametercustom(JdbcMapping jdbcMapping, JdbcParameterBinder binder) Create a parameter expression with provider-defined binding behavior.static JdbcParameterqueryLimit(BasicType<Integer> integerType) Create a query-limit parameter using the given persistence-unit-scopedIntegerbasic type.static JdbcParameterqueryLimit(TypeConfiguration typeConfiguration) Create a query-limit parameter using theIntegerbasic type registered with the current persistence unit.static JdbcParameterqueryOffset(BasicType<Integer> integerType) Create a query-offset parameter using the given persistence-unit-scopedIntegerbasic type.static JdbcParameterqueryOffset(TypeConfiguration typeConfiguration) Create a query-offset parameter using theIntegerbasic type registered with the current persistence unit.
-
Method Details
-
queryLimit
Create a query-limit parameter using the
Integerbasic type registered with the current persistence unit.Pass the
TypeConfigurationassociated with the current SQL AST translation request. The configuration is used only to resolve the type and is not retained. -
queryLimit
Create a query-limit parameter using the given persistence-unit-scoped
Integerbasic type.The parameter binds the maximum-row value from the original query options, or
Integer.MAX_VALUEwhen no maximum is specified. -
queryOffset
Create a query-offset parameter using the
Integerbasic type registered with the current persistence unit.Pass the
TypeConfigurationassociated with the current SQL AST translation request. The configuration is used only to resolve the type and is not retained. -
queryOffset
Create a query-offset parameter using the given persistence-unit-scoped
Integerbasic type.The parameter binds the first-row value from the original query options, or
0when no offset is specified. -
custom
@Nonnull public static JdbcParameter custom(@Nonnull JdbcMapping jdbcMapping, @Nonnull JdbcParameterBinder binder) Create a parameter expression with provider-defined binding behavior.
The returned parameter uses
jdbcMappingas its expression mapping and returnsbinderfromJdbcParameter.getParameterBinder(). Its parameter identifier isnull.
-