Package overit.geocall.sql
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
In particular it implements writing and reading (with transformations) of objects to / from the database
-
Method Summary
Modifier and TypeMethodDescriptionloadInstance(ResultSet rs, int field) Must implements the transformations and the reading of a field in a Java object, starting from aResultSet, the position and the information of theResultSetMetaDataloadInstance(ResultSet rs, int field, List<DataAttribute> dataAttributes, Company company) default ObjectloadInstance(ResultSet rs, int field, DataAttribute dataAttribute, Company company) voidsaveInstance(PreparedStatement ps, int field, Object o) Must implements the transformations and the writing of a Java object in aPreparedStatement, starting from the instance type of the java object
-
Method Details
-
loadInstance
Must implements the transformations and the reading of a field in a Java object, starting from aResultSet, the position and the information of theResultSetMetaData- 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
-
loadInstance
default List<Object> loadInstance(ResultSet rs, int field, List<DataAttribute> dataAttributes, Company company) throws SQLException Returns aList<Object> about the values of configuredEDMextended attributes contained in the providedResultSet.- 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
default Object loadInstance(ResultSet rs, int field, DataAttribute dataAttribute, Company company) throws SQLException Returns aObjectabout the value of configuredEDMextended attribute contained in the providedResultSet.- 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
-
saveInstance
Must implements the transformations and the writing of a Java object in aPreparedStatement, starting from the instance type of the java object- 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
-