Holger's
Java API

com.antelmann.crm
Class AddressableMapper<T extends Addressable & DBEntry>

java.lang.Object
  extended by com.antelmann.sql.WrappedObjectRowMapper<T>
      extended by com.antelmann.crm.AddressableMapper<T>
All Implemented Interfaces:
TransactionRequired, MappingInfo, ObjectRowMapper<T>, Wrapped<ObjectRowMapper<T>>

public class AddressableMapper<T extends Addressable & DBEntry>
extends WrappedObjectRowMapper<T>

handles the address of a given addressable entry

Since:
21.11.2008, 13:34:38
Author:
Holger Antelmann

Field Summary
 
Fields inherited from class com.antelmann.sql.WrappedObjectRowMapper
mapper
 
Constructor Summary
AddressableMapper(BaseRowMapper<T> mapper, PropertyEntryWithAddress addressConfig)
           
 
Method Summary
 T instantiate(RowItem row)
          instantiates the DBEntry based on the properties in the given row.
 RowItem mapToRow(T object)
          generates a RowItem containing all relevant properties, so that it can be used to store the object into the database
 
Methods inherited from class com.antelmann.sql.WrappedObjectRowMapper
extractStub, generateNewID, getColumnNames, getColumnsForTopic, getColumnSize, getConnection, getDisplayColumn, getDisplayNameForColumn, getIDColumn, getMappingForTopic, getRestrictMappedColumns, getResultSet, getSQLTypeforColumn, getStubResultSet, getTableName, getTableQuery, handleAfterStore, unwrap, verifyBeforeDelete, verifyBeforeStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddressableMapper

public AddressableMapper(BaseRowMapper<T> mapper,
                         PropertyEntryWithAddress addressConfig)
Method Detail

instantiate

public T instantiate(RowItem row)
                                           throws Exception
Description copied from interface: ObjectRowMapper
instantiates the DBEntry based on the properties in the given row. The given row contains all the columns of the queried ResultSet unless the columns to be retrieved are restricted by ObjectRowMapper.getRestrictMappedColumns().

Specified by:
instantiate in interface ObjectRowMapper<T extends Addressable & DBEntry>
Overrides:
instantiate in class WrappedObjectRowMapper<T extends Addressable & DBEntry>
Throws:
Exception

mapToRow

public RowItem mapToRow(T object)
                 throws WrongDataException
Description copied from interface: ObjectRowMapper
generates a RowItem containing all relevant properties, so that it can be used to store the object into the database

Specified by:
mapToRow in interface ObjectRowMapper<T extends Addressable & DBEntry>
Overrides:
mapToRow in class WrappedObjectRowMapper<T extends Addressable & DBEntry>
Throws:
WrongDataException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads