Package overit.geocall.sql
Class StandardDBObjectMap
java.lang.Object
overit.geocall.sql.StandardDBObjectMap
- All Implemented Interfaces:
Serializable,DBObjectMap
The class implements a standard
DBObjectMap- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty StandardDBObjectMapStandardDBObjectMap(boolean b) Creates an empty StandardDBObjectMap with the possibility to indicate if theDatewill be transformed intooracle.sql.DATE -
Method Summary
Modifier and TypeMethodDescriptionprotected final overit.geocall.edm.service.DataAttributeConverterprotected final overit.geocall.edm.service.ExtendedAttributesDeserializerloadInstance(ResultSet rs, int field) Implements the reading and transformation of a field into a Java object, starting from aResultSet, the position and the information of theResultSetMetaData.loadInstance(ResultSet rs, int field, List<DataAttribute> dataAttributes, Company company) loadInstance(ResultSet rs, int field, DataAttribute dataAttribute, Company company) voidsaveInstance(PreparedStatement ps, int field, Object o) Implements the transformations and writing of a Java object in a PreparedStatement, starting from the instance type of the java object.
-
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 theDatewill be transformed intooracle.sql.DATE- Parameters:
b-trueif theDatemust be transformed intooracle.sql.DATE,falseotherwise
-
-
Method Details
-
loadInstance
public List<Object> loadInstance(ResultSet rs, int field, List<DataAttribute> dataAttributes, Company company) throws SQLException Description copied from interface:DBObjectMapReturns aList<Object> about the values of configuredEDMextended attributes contained in the providedResultSet.- Specified by:
loadInstancein interfaceDBObjectMap- Parameters:
rs-ResultSetfrom which retrieve the values of the configuredEDMextended attributes.field- Number of the field to read from theResultSet.dataAttributes-List<DataAttribute> about the configured extended data attributes.company-Companycurrently in use.- Returns:
- a
List<Object> about the values of configuredEDMextended attributes contained in the providedResultSet. - Throws:
SQLException- The operation of reading from the database can raise anSQLException
-
loadInstance
public Object loadInstance(ResultSet rs, int field, DataAttribute dataAttribute, Company company) throws SQLException Description copied from interface:DBObjectMapReturns aObjectabout the value of configuredEDMextended attribute contained in the providedResultSet.- Specified by:
loadInstancein interfaceDBObjectMap- Parameters:
rs-ResultSetfrom which retrieve the value of the configuredEDMextended attribute.field- Number of the field to read from theResultSet.dataAttribute-DataAttributeabout the configured extended data attribute.company-Companycurrently in use.- Returns:
- a
Objectabout the value of configuredEDMextended attribute contained in the providedResultSet. - Throws:
SQLException- The operation of reading from the database can raise anSQLException
-
loadInstance
Implements the reading and transformation of a field into a Java object, starting from aResultSet, the position and the information of theResultSetMetaData.
The realized conversion transform the SQLTIMESTAMPinDate, theVARCHARinString, theNUMERICwith decimals inDoubleand theNUMERICwithout decimals inLong- Specified by:
loadInstancein interfaceDBObjectMap- Parameters:
rs- The ResultSet from which retrieve the ResultSetMetaData and the values used to create the Java objectfield- 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 anSQLException
-
saveInstance
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 fromDatetoTIMESTAMP, otherwise it will be used the classicsetObject()method.- Specified by:
saveInstancein interfaceDBObjectMap- Parameters:
ps- The PreparedStatement in which we must set the objectfield- The position of the parameter in the PreparedStatemento- The Java object- Throws:
SQLException- The database communication can raise anSQLException
-
getExtendedAttributesDeserializer
protected final overit.geocall.edm.service.ExtendedAttributesDeserializer getExtendedAttributesDeserializer() -
getDataAttributeConverter
protected final overit.geocall.edm.service.DataAttributeConverter getDataAttributeConverter()
-