Interface DBObjectMap

All Known Implementing Classes:
DBDrivenLoader, DBObject, StandardDBObjectMap

public interface DBObjectMap
Interface that realizes a general map between Java objects in memory and SQL objects.
In particular it implements writing and reading (with transformations) of objects to / from the database
  • Method Details

    • loadInstance

      Object loadInstance(ResultSet rs, int field) throws SQLException
      Must implements the transformations and the reading of a field in a Java object, starting from a ResultSet, the position and the information of the ResultSetMetaData
      Parameters:
      rs - The ResultSet from which retrieve the ResultSetMetaData and the values used to create the Java object
      field - Number of the field to read from the ResultSet
      Returns:
      The created object instance
      Throws:
      SQLException - The operation of reading from the database can raise an SQLException
    • loadInstance

      default List<Object> loadInstance(ResultSet rs, int field, List<DataAttribute> dataAttributes, Company company) throws SQLException
      Returns a List<Object> about the values of configured EDM extended attributes contained in the provided ResultSet.
      Parameters:
      rs - ResultSet from which retrieve the values of the configured EDM extended attributes.
      field - Number of the field to read from the ResultSet.
      dataAttributes - List<DataAttribute> about the configured extended data attributes.
      company - Company currently in use.
      Returns:
      a List<Object> about the values of configured EDM extended attributes contained in the provided ResultSet.
      Throws:
      SQLException - The operation of reading from the database can raise an SQLException
    • loadInstance

      default Object loadInstance(ResultSet rs, int field, DataAttribute dataAttribute, Company company) throws SQLException
      Returns a Object about the value of configured EDM extended attribute contained in the provided ResultSet.
      Parameters:
      rs - ResultSet from which retrieve the value of the configured EDM extended attribute.
      field - Number of the field to read from the ResultSet.
      dataAttribute - DataAttribute about the configured extended data attribute.
      company - Company currently in use.
      Returns:
      a Object about the value of configured EDM extended attribute contained in the provided ResultSet.
      Throws:
      SQLException - The operation of reading from the database can raise an SQLException
    • saveInstance

      void saveInstance(PreparedStatement ps, int field, Object o) throws SQLException
      Must implements the transformations and the writing of a Java object in a PreparedStatement, starting from the instance type of the java object
      Parameters:
      ps - The PreparedStatement in which we must set the object
      field - The position of the parameter in the PreparedStatement
      o - The Java object
      Throws:
      SQLException - The database communication can raise an SQLException