|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ObjectRowMapper<T extends DBEntry>
provides methods to convert an object to a RowItem and vice versa to facilitate persistent storage with JDBC for simple objects.
JDBCRowStore,
WrappedDBClassStoreMapping,
BaseRowMapper| Method Summary | |
|---|---|
Stub<T> |
extractStub(ResultSet rs,
Class<T> typeClass)
|
Object |
generateNewID()
|
Connection |
getConnection()
|
String[] |
getRestrictMappedColumns()
allows to limit the columns retrieved from a ResultSet when loading the data from a table query. |
ResultSet |
getResultSet(Filter<? super T> filter)
constructs the ResultSet used for fetching entries that corresponds closest to the filter; note that the filter may be null, in which case the select statement should return all rows. |
ResultSet |
getStubResultSet(Filter<? super Stub<?>> filter)
creates and returns the ResultSet used for fetching stubs that corresponds closest to the filter for extracting Stub entries. |
void |
handleAfterStore(T entry,
boolean isInsert)
called by the store after a given entry is either inserted or updated, so that additional updates (other than providing the RowItem for storage) can take place. |
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 |
void |
verifyBeforeDelete(Object id)
called by the store before a given entry is deleted, so that additional checks can easily be incorporated. |
void |
verifyBeforeStore(T entry,
boolean isInsert)
called by the store before a given entry is either inserted or updated, so that additional checks can easily be incorporated. |
| Methods inherited from interface com.antelmann.sql.MappingInfo |
|---|
getColumnNames, getColumnsForTopic, getColumnSize, getDisplayColumn, getDisplayNameForColumn, getIDColumn, getMappingForTopic, getSQLTypeforColumn, getTableName, getTableQuery |
| Method Detail |
|---|
Connection getConnection()
Object generateNewID()
throws DatabaseException,
UnsupportedOperationException
DatabaseException
UnsupportedOperationExceptionDBClassStore.generateNewID(),
SQLNumberGenerator,
TransactionalNumberGenerator
T instantiate(RowItem row)
throws Exception
getRestrictMappedColumns().
Exception
RowItem mapToRow(T object)
throws WrongDataException
WrongDataException
void verifyBeforeStore(T entry,
boolean isInsert)
throws DatabaseException,
SQLException
isInsert - if true, the entry is about to be inserted; if false, it is an update
DatabaseException
SQLException
void handleAfterStore(T entry,
boolean isInsert)
throws DatabaseException,
SQLException
isInsert - if true, the entry is about to be inserted; if false, it is an update
DatabaseException
SQLException
void verifyBeforeDelete(Object id)
throws DatabaseException,
SQLException
DBClassStore.deleteEntries(Filter)
is called and JDBCRowStore.isFastDelete() returns is true!
WrongDataException - if the deletion is not allowed for semantical reasons
DatabaseException
SQLException
Stub<T> extractStub(ResultSet rs,
Class<T> typeClass)
throws SQLException
SQLException
ResultSet getResultSet(Filter<? super T> filter)
throws SQLException
SQLException
ResultSet getStubResultSet(Filter<? super Stub<?>> filter)
throws SQLException
SQLExceptionString[] getRestrictMappedColumns()
ResultSet when extracting the data into a RowItem; null may be returned.instantiate(RowItem)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||