Class TupleMappers

java.lang.Object
org.jdbi.v3.vavr.TupleMappers
All Implemented Interfaces:
JdbiConfig<TupleMappers>, MapEntryConfig<TupleMappers>

public class TupleMappers extends Object implements JdbiConfig<TupleMappers>, MapEntryConfig<TupleMappers>
Mappers similar to MapEntryMappers but map entries in vavr are in fact of type Tuple2.
  • Constructor Details

    • TupleMappers

      public TupleMappers()
  • Method Details

    • getKeyColumn

      public String getKeyColumn()
      Specified by:
      getKeyColumn in interface MapEntryConfig<TupleMappers>
    • setKeyColumn

      public TupleMappers setKeyColumn(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
    • getValueColumn

      public String getValueColumn()
      Specified by:
      getValueColumn in interface MapEntryConfig<TupleMappers>
    • setValueColumn

      public TupleMappers setValueColumn(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, 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 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