Interface DbMapper<T>

    • Method Detail

      • read

        T read​(DbRow row)
        Read database row and convert it to target type instance.
        Parameters:
        row - source database row
        Returns:
        target type instance containing database row
      • toNamedParameters

        Map<String,​?> toNamedParameters​(T value)
        Convert target type instance to a statement named parameters map.
        Parameters:
        value - mapping type instance containing values to be set into statement
        Returns:
        map of statement named parameters mapped to values to be set
        See Also:
        DbStatement.namedParam(Object)
      • toIndexedParameters

        List<?> toIndexedParameters​(T value)
        Convert target type instance to a statement indexed parameters list.

        Using indexed parameters with typed values is probably not going to work nicely, unless the order is specified and the number of parameters is always related the provided value. There are cases where this is useful though - e.g. for types that represent an iterable collection.

        Parameters:
        value - mapping type instance containing values to be set into statement
        Returns:
        map of statement named parameters mapped to values to be set
        See Also:
        DbStatement.indexedParam(Object)