Class TupleMappers

    • Field Detail

      • KEY_COLUMN_TUPLE_INDEX

        private static final int KEY_COLUMN_TUPLE_INDEX
        See Also:
        Constant Field Values
      • VALUE_COLUMN_TUPLE_INDEX

        private static final int VALUE_COLUMN_TUPLE_INDEX
        See Also:
        Constant Field Values
      • columns

        private java.lang.String[] columns
    • Constructor Detail

      • TupleMappers

        public TupleMappers()
    • Method Detail

      • setKeyColumn

        public TupleMappers setKeyColumn​(java.lang.String keyColumn)
        Description copied from interface: MapEntryConfig
        Sets the column that map entry keys are loaded from. If set, keys will be loaded from the given column, using the ColumnMapper registered for the key type. If unset, keys will be loaded using the RowMapper registered for the key type, from whichever columns that row mapper uses.
        Specified by:
        setKeyColumn in interface MapEntryConfig<TupleMappers>
        Parameters:
        keyColumn - the key column name. not null
        Returns:
        this config object, for call chaining
      • setValueColumn

        public TupleMappers setValueColumn​(java.lang.String valueColumn)
        Description copied from interface: MapEntryConfig
        Sets the column that map entry values are loaded from. If set, values will be loaded from the given column, using the ColumnMapper registered for the value type. If unset, values will be loaded using the RowMapper registered for the value type, from whichever columns that row mapper uses.
        Specified by:
        setValueColumn in interface MapEntryConfig<TupleMappers>
        Parameters:
        valueColumn - the value column name. not null
        Returns:
        this config object, for call chaining
      • setColumn

        public TupleMappers setColumn​(int tupleIndex,
                                      java.lang.String name)
        Names a specific column in the mapper.
        Parameters:
        tupleIndex - the 1 based index of the TupleX. as in _1, _2 etc.
        name - the column name to be mapped explicitly
        Returns:
        Config object for chaining
      • getColumn

        public java.lang.String getColumn​(int tupleIndex)
        Returns the name for a column.
        Parameters:
        tupleIndex - the 1 based index of the TupleX. as in _1, _2 etc.
        Returns:
        the column name to be mapped explicitly
      • createCopy

        public TupleMappers 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<TupleMappers>
        Returns:
        a copy of this configuration object.
      • 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<TupleMappers>
        Parameters:
        registry - the registry that owns this configuration object