Class JdbcOutParameterRegistrar

java.lang.Object
org.seasar.doma.jdbc.command.JdbcOutParameterRegistrar
All Implemented Interfaces:
JdbcMappingFunction

public class JdbcOutParameterRegistrar extends Object implements JdbcMappingFunction
A function that registers output parameters for a callable statement.

This class is used to register output parameters for stored procedures and functions. It implements JdbcMappingFunction to handle different JDBC types.

  • Field Details

    • callableStatement

      protected final CallableStatement callableStatement
      The callable statement to register output parameters for.
    • index

      protected final int index
      The parameter index in the callable statement.
  • Constructor Details

    • JdbcOutParameterRegistrar

      public JdbcOutParameterRegistrar(CallableStatement callableStatement, int index)
      Creates a new instance.
      Parameters:
      callableStatement - the callable statement to register output parameters for
      index - the parameter index in the callable statement
      Throws:
      NullPointerException - if the callable statement is null
      IllegalArgumentException - if the index is less than or equal to 0
  • Method Details

    • apply

      public <R, V> R apply(Wrapper<V> wrapper, JdbcType<V> jdbcType) throws SQLException
      Applies this function to register an output parameter.
      Specified by:
      apply in interface JdbcMappingFunction
      Type Parameters:
      R - the result type
      V - the value type
      Parameters:
      wrapper - the wrapper for the value
      jdbcType - the JDBC type
      Returns:
      always null
      Throws:
      SQLException - if a database access error occurs
      DomaNullPointerException - if the jdbcType is null