Class StandardDBObjectMap

java.lang.Object
overit.geocall.sql.StandardDBObjectMap
All Implemented Interfaces:
Serializable, DBObjectMap

public class StandardDBObjectMap extends Object implements DBObjectMap, Serializable
The class implements a standard DBObjectMap
See Also:
  • Field Details

    • dateMapper

      protected boolean dateMapper
  • Constructor Details

    • StandardDBObjectMap

      public StandardDBObjectMap()
      Creates an empty StandardDBObjectMap
    • StandardDBObjectMap

      public StandardDBObjectMap(boolean b)
      Creates an empty StandardDBObjectMap with the possibility to indicate if the Date will be transformed into oracle.sql.DATE
      Parameters:
      b - true if the Date must be transformed into oracle.sql.DATE, false otherwise
  • Method Details

    • loadInstance

      public List<Object> loadInstance(ResultSet rs, int field, List<DataAttribute> dataAttributes, Company company) throws SQLException
      Description copied from interface: DBObjectMap
      Returns a List<Object> about the values of configured EDM extended attributes contained in the provided ResultSet.
      Specified by:
      loadInstance in interface DBObjectMap
      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

      public Object loadInstance(ResultSet rs, int field, DataAttribute dataAttribute, Company company) throws SQLException
      Description copied from interface: DBObjectMap
      Returns a Object about the value of configured EDM extended attribute contained in the provided ResultSet.
      Specified by:
      loadInstance in interface DBObjectMap
      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
    • loadInstance

      public Object loadInstance(ResultSet rs, int field) throws SQLException
      Implements the reading and transformation of a field into a Java object, starting from a ResultSet, the position and the information of the ResultSetMetaData.
      The realized conversion transform the SQL TIMESTAMP in Date, the VARCHAR in String, the NUMERIC with decimals in Double and the NUMERIC without decimals in Long
      Specified by:
      loadInstance in interface DBObjectMap
      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
    • saveInstance

      public void saveInstance(PreparedStatement ps, int field, Object o) throws SQLException
      Implements the transformations and writing of a Java object in a PreparedStatement, starting from the instance type of the java object.
      The realized transformation is from Date to TIMESTAMP, otherwise it will be used the classic setObject() method.
      Specified by:
      saveInstance in interface DBObjectMap
      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
    • getExtendedAttributesDeserializer

      protected final overit.geocall.edm.service.ExtendedAttributesDeserializer getExtendedAttributesDeserializer()
    • getDataAttributeConverter

      protected final overit.geocall.edm.service.DataAttributeConverter getDataAttributeConverter()