Module storm.java

Class BuilderImpl

java.lang.Object
st.orm.template.impl.BuilderImpl
All Implemented Interfaces:
ORMTemplate.Builder

public final class BuilderImpl extends Object implements ORMTemplate.Builder
Builds the Java facade over an engine template builder.

Storm's integrations compose the engine builder first, handing it the connection and transaction strategies that bridge their platform, and wrap it here so the application-facing options and the customization callbacks apply on top of that composition.

Since:
1.14
  • Constructor Details

    • BuilderImpl

      public BuilderImpl(st.orm.core.template.ORMTemplate.Builder core)
  • Method Details

    • config

      public ORMTemplate.Builder config(StormConfig config)
      Description copied from interface: ORMTemplate.Builder
      Sets the Storm configuration to apply to the template instance.
      Specified by:
      config in interface ORMTemplate.Builder
      Parameters:
      config - the Storm configuration; must not be null.
      Returns:
      this builder.
    • decorator

      public ORMTemplate.Builder decorator(UnaryOperator<TemplateDecorator> decorator)
      Description copied from interface: ORMTemplate.Builder
      Sets a function that transforms the TemplateDecorator to customize template processing.
      Specified by:
      decorator in interface ORMTemplate.Builder
      Parameters:
      decorator - the decorator function; must not be null.
      Returns:
      this builder.
    • manualCommitConnections

      public ORMTemplate.Builder manualCommitConnections()
      Description copied from interface: ORMTemplate.Builder
      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; ORMTemplate.Builder.build() fails fast otherwise.

      Specified by:
      manualCommitConnections in interface ORMTemplate.Builder
      Returns:
      this builder.
    • exceptionMapper

      public ORMTemplate.Builder exceptionMapper(ExceptionMapper exceptionMapper)
      Description copied from interface: ORMTemplate.Builder
      Sets the exception mapper that maps failures raised during query execution to the runtime exception thrown to the caller.
      Specified by:
      exceptionMapper in interface ORMTemplate.Builder
      Parameters:
      exceptionMapper - the exception mapper; must not be null.
      Returns:
      this builder.
    • queryObserver

      public ORMTemplate.Builder queryObserver(QueryObserver queryObserver)
      Description copied from interface: ORMTemplate.Builder
      Sets the query observer that is notified of query executions performed by the template.
      Specified by:
      queryObserver in interface ORMTemplate.Builder
      Parameters:
      queryObserver - the query observer; must not be null.
      Returns:
      this builder.
    • sqlCommenter

      public ORMTemplate.Builder sqlCommenter(SqlCommenter sqlCommenter)
      Description copied from interface: ORMTemplate.Builder
      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.
      Specified by:
      sqlCommenter in interface ORMTemplate.Builder
      Parameters:
      sqlCommenter - the SQL commenter; must not be null.
      Returns:
      this builder.
    • build

      public ORMTemplate build()
      Description copied from interface: ORMTemplate.Builder
      Builds the ORM template.
      Specified by:
      build in interface ORMTemplate.Builder
      Returns:
      the ORM template.