Class RowMapper<T>

java.lang.Object
de.chojo.sadu.mapper.rowmapper.RowMapper<T>
Type Parameters:
T - type of returned object
All Implemented Interfaces:
RowMapping<T>

public class RowMapper<T> extends Object implements RowMapping<T>
Class representing the mapping of a column to an object.
  • Method Details

    • forClass

      public static <T> PartialRowMapper<T> forClass(Class<T> clazz)
    • clazz

      public Class<T> clazz()
    • columns

      public Set<String> columns()
    • map

      public T map(Row row) throws SQLException
      Specified by:
      map in interface RowMapping<T>
      Throws:
      SQLException
    • isWildcard

      public boolean isWildcard()
    • applicable

      public int applicable(ResultSet resultSet) throws SQLException
      Checks how many rows of the result set are applicable.
      Parameters:
      resultSet - result set
      Returns:
      If the result set is not applicable 0 will be returned. Otherwise, the count of applicable rows will be returned.
      Throws:
      SQLException
    • applicable

      public int applicable(ResultSet resultSet, MapperConfig config) throws SQLException
      Checks how many rows of the result set are applicable.
      Parameters:
      resultSet - result set
      Returns:
      If the result set is not applicable 0 will be returned. Otherwise, the count of applicable rows will be returned.
      Throws:
      SQLException
    • applicable

      public int applicable(ResultSetMetaData meta)
      Checks how many rows of the result set are applicable.
      Parameters:
      meta - meta of a result set
      Returns:
      If the result set is not applicable 0 will be returned. Otherwise, the count of applicable rows will be returned.
    • applicable

      public int applicable(ResultSetMetaData meta, MapperConfig config)
      Checks how many rows of the result set are applicable.
      Parameters:
      meta - meta of a result set
      config - mapper config
      Returns:
      If the result set is not applicable 0 will be returned. Otherwise, the count of applicable rows will be returned.
    • toString

      public String toString()
      Overrides:
      toString in class Object