Class SqlArrayTypes

    • Constructor Detail

      • SqlArrayTypes

        public SqlArrayTypes()
    • Method Detail

      • getArgumentStrategy

        public SqlArrayArgumentStrategy getArgumentStrategy()
        Returns the strategy used to bind array-type arguments to SQL statements.
        Returns:
        the strategy used to bind array-type arguments to SQL statements
      • setArgumentStrategy

        public SqlArrayTypes setArgumentStrategy​(SqlArrayArgumentStrategy argumentStrategy)
        Sets the strategy used when binding array-type arguments to SQL statements.
        Parameters:
        argumentStrategy - the argument strategy to set
        Returns:
        this
      • register

        public SqlArrayTypes register​(java.lang.Class<?> elementType,
                                      java.lang.String sqlTypeName)
        Register an array element type that is supported by the JDBC vendor.
        Parameters:
        elementType - the array element type
        sqlTypeName - the vendor-specific SQL type name for the array type. This value will be passed to Connection.createArrayOf(String, Object[]) to create SQL arrays.
        Returns:
        this
      • register

        public SqlArrayTypes register​(SqlArrayType<?> arrayType)
        Register a SqlArrayType which will have its parameterized type inspected to determine which element type it supports. SQL array types are used to convert array-like arguments into SQL arrays.

        The parameter must be concretely parameterized; we use the type argument T to determine if it applies to a given element type.

        Parameters:
        arrayType - the SqlArrayType
        Returns:
        this
        Throws:
        java.lang.UnsupportedOperationException - if the argument is not a concretely parameterized type
      • findFor

        public java.util.Optional<SqlArrayType<?>> findFor​(java.lang.reflect.Type elementType)
        Obtain an SqlArrayType for the given array element type in the given context
        Parameters:
        elementType - the array element type.
        Returns:
        an SqlArrayType for the given element type.
      • setRegistry

        public void setRegistry​(ConfigRegistry registry)
        Description copied from interface: JdbiConfig
        The registry will inject itself into the configuration object. This can be useful if you need to look up dependencies. You will get a new registry after being copied.
        Specified by:
        setRegistry in interface JdbiConfig<SqlArrayTypes>
        Parameters:
        registry - the registry that owns this configuration object
      • createCopy

        public SqlArrayTypes createCopy()
        Description copied from interface: JdbiConfig
        Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.
        Specified by:
        createCopy in interface JdbiConfig<SqlArrayTypes>
        Returns:
        a copy of this configuration object.