Holger's
Java API

com.antelmann.sql
Class SerializedEntrySQLMapper<T extends DBEntry>

java.lang.Object
  extended by com.antelmann.sql.BaseRowMapper<T>
      extended by com.antelmann.sql.SerializedEntrySQLMapper<T>
All Implemented Interfaces:
TransactionRequired, MappingInfo, ObjectRowMapper<T>, Converter<RowItem,T>

public class SerializedEntrySQLMapper<T extends DBEntry>
extends BaseRowMapper<T>

implements a simple mapper that serializes the entire object and stores it as a stream

Since:
29. September 2006, 21:09
Author:
Holger Antelmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.util.Converter
Converter.Adapter<T1,T2>
 
Field Summary
 
Fields inherited from class com.antelmann.sql.BaseRowMapper
db, helper
 
Constructor Summary
SerializedEntrySQLMapper(Database<Connection> db, String tableName, String idColumnName, String displayColumn, String objectStreamColumnName)
           
 
Method Summary
 Integer generateNewID()
          returns the return value of the given IDFactory or throws UnsupportedOperationException if no IDFactory was supplied
protected  Map<String,Object> generateRowProperties(DBEntry entry)
          generates a map that contains all columns mapped to their values, so that the map can be used to store the object into a row.
 T instantiate(RowItem row)
          instantiates the DBEntry based on the properties in the given row.
 
Methods inherited from class com.antelmann.sql.BaseRowMapper
addColumnsForTopic, applyFromMapping, checkExistence, convert, convertBack, convertTopicFilter, emptyStringsToNull, extractReference, extractStub, extractStub, getAll, getColumnDisplayMapping, getColumnNames, getColumnsForTopic, getColumnSize, getConnection, getConnectionHelper, getDisplayColumn, getDisplayNameForColumn, getEntryClass, getEntryClassMapper, getIDColumn, getIDFactory, getMappedValue, getMappingForTopic, getNextIntID, getNextIntIDFactory, getNextIntIDFactory, getPreStoreFilter, getReadOnlyColumns, getRestrictMappedColumns, getResultSet, getSQLTypeforColumn, getStubColumns, getStubQuery, getStubResultSet, getSupportedTopicColumns, getTableColumnNames, getTableName, getTableQuery, getTableQueryForComboFilter, getTransactionCounter, getUniqueRandomString, handleAfterStore, initMapping, isMappedTopic, isTranslate, javaToSql, javaToSql, lockTable, mapReference, mapReference, mapToRow, removeColumnTopic, setColumnsForTopic, setDisplayColumn, setEntryClass, setEntryClassMapper, setIDFactory, setMappedValue, setNextIntIdAsFactory, setPreStoreFilter, setReadOnlyColumns, setRestrictedMappedColumns, setStubQuery, setTableQuery, setTableQuery, setTopic, setTranslate, sqlToJava, toSQLMap, verifyBeforeDelete, verifyBeforeStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializedEntrySQLMapper

public SerializedEntrySQLMapper(Database<Connection> db,
                                String tableName,
                                String idColumnName,
                                String displayColumn,
                                String objectStreamColumnName)
                         throws DatabaseException
Throws:
DatabaseException
Method Detail

generateRowProperties

protected Map<String,Object> generateRowProperties(DBEntry entry)
Description copied from class: BaseRowMapper
generates a map that contains all columns mapped to their values, so that the map can be used to store the object into a row. The ID column and the corresponding ID should not be put in there, as this will happen automatically later.

Specified by:
generateRowProperties in class BaseRowMapper<T extends DBEntry>

generateNewID

public Integer generateNewID()
                      throws DatabaseException
Description copied from class: BaseRowMapper
returns the return value of the given IDFactory or throws UnsupportedOperationException if no IDFactory was supplied

Specified by:
generateNewID in interface ObjectRowMapper<T extends DBEntry>
Overrides:
generateNewID in class BaseRowMapper<T extends DBEntry>
Throws:
DatabaseException
See Also:
DBClassStore.generateNewID(), SQLNumberGenerator, TransactionalNumberGenerator

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().

Throws:
Exception


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