com.antelmann.sql
Class RelationshipStore.Mapper<T extends DefaultEntryRelationship>
java.lang.Object
com.antelmann.sql.BaseRowMapper<T>
com.antelmann.sql.RelationshipStore.Mapper<T>
- All Implemented Interfaces:
- TransactionRequired, MappingInfo, ObjectRowMapper<T>, Converter<RowItem,T>
- Enclosing class:
- RelationshipStore<T extends DefaultEntryRelationship>
public static class RelationshipStore.Mapper<T extends DefaultEntryRelationship>
- extends BaseRowMapper<T>
|
Constructor Summary |
RelationshipStore.Mapper(Database<Connection> db,
String tableName,
String idColumn,
IDFactory idFactory,
Class<T> type)
|
RelationshipStore.Mapper(Database<Connection> db,
String tableName,
String idColumn,
Map<RelationshipManager.Column,String> config,
IDFactory idFactory,
Class<T> type)
|
RelationshipStore.Mapper(Database<Connection> db,
String tableName,
String idColumn,
Map<RelationshipManager.Column,String> config,
IDFactory idFactory,
Class<T> type,
String query)
|
| Methods inherited from class com.antelmann.sql.BaseRowMapper |
addColumnsForTopic, applyFromMapping, checkExistence, convert, convertBack, convertTopicFilter, emptyStringsToNull, extractReference, extractStub, extractStub, generateNewID, 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, setIDFactory, setMappedValue, setNextIntIdAsFactory, setPreStoreFilter, setReadOnlyColumns, setRestrictedMappedColumns, setStubQuery, setTableQuery, setTableQuery, setTopic, setTranslate, sqlToJava, toSQLMap, verifyBeforeDelete |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RelationshipStore.Mapper
public RelationshipStore.Mapper(Database<Connection> db,
String tableName,
String idColumn,
IDFactory idFactory,
Class<T> type)
throws DatabaseException
- Throws:
DatabaseException
RelationshipStore.Mapper
public RelationshipStore.Mapper(Database<Connection> db,
String tableName,
String idColumn,
Map<RelationshipManager.Column,String> config,
IDFactory idFactory,
Class<T> type)
throws DatabaseException
- Throws:
DatabaseException
RelationshipStore.Mapper
public RelationshipStore.Mapper(Database<Connection> db,
String tableName,
String idColumn,
Map<RelationshipManager.Column,String> config,
IDFactory idFactory,
Class<T> type,
String query)
throws DatabaseException
- Throws:
DatabaseException
setEntryClassMapper
public void setEntryClassMapper(EntryClassMapper ecm)
- Overrides:
setEntryClassMapper in class BaseRowMapper<T extends DefaultEntryRelationship>
setFromClass
protected void setFromClass(Class<? extends DBEntry> c)
setToClass
protected void setToClass(Class<? extends DBEntry> c)
getDefaultRelationType
public Object getDefaultRelationType()
setDefaultRelationType
public void setDefaultRelationType(Object defaultRelationType)
generateRowProperties
protected Map<String,Object> generateRowProperties(T entry)
throws WrongDataException
- 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 DefaultEntryRelationship>
- Throws:
WrongDataException
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
isPreventSameRelation
public boolean isPreventSameRelation()
setPreventSameRelation
public void setPreventSameRelation(boolean preventSameRelation)
isVerifyRelationsOnStore
public boolean isVerifyRelationsOnStore()
setVerifyRelationsOnStore
public void setVerifyRelationsOnStore(boolean flag)
verifyBeforeStore
public void verifyBeforeStore(T entry,
boolean isInsert)
throws DatabaseException,
SQLException
- Description copied from class:
BaseRowMapper
- checks whether the filter (if non-null) accepts the entry.
If the entry is not accepted by the filter, a
NotApplicableDataWarning is thrown.
When overriding this method, it is advised to call this super implementation.
- Specified by:
verifyBeforeStore in interface ObjectRowMapper<T extends DefaultEntryRelationship>- Overrides:
verifyBeforeStore in class BaseRowMapper<T extends DefaultEntryRelationship>
isInsert - if true, the entry is about to be inserted; if false, it is an update
- Throws:
DatabaseException
SQLException- See Also:
BaseRowMapper.setPreStoreFilter(Filter)
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads