- All Known Implementing Classes:
BuilderImpl
- Enclosing interface:
ORMTemplate
public static interface ORMTemplate.Builder
Builder for constructing an
ORMTemplate with instance-scoped integration strategies.- Since:
- 1.13
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the ORM template.config(StormConfig config) Sets the Storm configuration to apply to the template instance.decorator(UnaryOperator<TemplateDecorator> decorator) Sets a function that transforms theTemplateDecoratorto customize template processing.exceptionMapper(ExceptionMapper exceptionMapper) Sets the exception mapper that maps failures raised during query execution to the runtime exception thrown to the caller.Declares that the data source hands out connections with auto-commit disabled.queryObserver(QueryObserver queryObserver) Sets the query observer that is notified of query executions performed by the template.sqlCommenter(SqlCommenter sqlCommenter) Sets the SQL commenter that appends per-execution comment content to statements, such as the current trace context.
-
Method Details
-
config
Sets the Storm configuration to apply to the template instance.- Parameters:
config- the Storm configuration; must not benull.- Returns:
- this builder.
-
decorator
Sets a function that transforms theTemplateDecoratorto customize template processing.- Parameters:
decorator- the decorator function; must not benull.- Returns:
- this builder.
-
manualCommitConnections
ORMTemplate.Builder manualCommitConnections()Declares that the data source hands out connections with auto-commit disabled.The declared mode is verified in both directions: a declared template that receives an auto-commit connection fails fast naming the misdeclaration, exactly like an undeclared template that receives a manual-commit one. With the declaration in place, the transactional path performs no auto-commit flips and releases connections in their arrived state; non-transactional connections get auto-commit enabled while Storm uses them and restored before release, so each statement still commits.
Cannot be combined with a custom connection provider and only valid for data source backed templates;
build()fails fast otherwise.- Returns:
- this builder.
- Since:
- 1.14
-
exceptionMapper
Sets the exception mapper that maps failures raised during query execution to the runtime exception thrown to the caller.- Parameters:
exceptionMapper- the exception mapper; must not benull.- Returns:
- this builder.
-
queryObserver
Sets the query observer that is notified of query executions performed by the template.- Parameters:
queryObserver- the query observer; must not benull.- Returns:
- this builder.
-
sqlCommenter
Sets the SQL commenter that appends per-execution comment content to statements, such as the current trace context. Note that per-execution content defeats prepared statement caching.- Parameters:
sqlCommenter- the SQL commenter; must not benull.- Returns:
- this builder.
- Since:
- 1.13
-
build
ORMTemplate build()Builds the ORM template.- Returns:
- the ORM template.
-