|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.sql.JDBCRowStore<T>
com.antelmann.sql.DetailRowStore<T>
PropertyEntryTableStore instead
@Deprecated public class DetailRowStore<T extends PropertyEntry>
a specialized store that provides help for dealing with PropertyEntry objects, assuming that the properties are to be stored in a separate detail table. This implementation does currently NOT support PropertyEntryFilter in a special way. The mapper used with this class must completely ignore the fact that the DBEntry to be mapped is in fact a PropertyEntry. Note that fastDelete should always be left false here, because otherwise, the detail data would not be deleted if deletion is based on a filter.
PropertyEntryFilter,
PropertyEntryTableStore,
PropertyEntryTableStore| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.db.DBClassStore |
|---|
DBClassStore.DBMethod |
| Field Summary |
|---|
| Fields inherited from class com.antelmann.sql.JDBCRowStore |
|---|
database, ensureTransactionsOnFetch, helper, mapper |
| Constructor Summary | |
|---|---|
DetailRowStore(Database<Connection> db,
ObjectRowMapper<T> flatMapper,
Class<T> type,
String detailTable,
String detailIdColumn,
String detailKeyColumn,
String detailValueColumn)
Deprecated. |
|
| Method Summary | |
|---|---|
protected void |
deleteDetails(Object id)
Deprecated. |
int |
deleteEntries(Filter<? super T> filter)
Deprecated. supports SQLMapFilter for more effective deletion. |
boolean |
deleteEntry(Object id)
Deprecated. removes the entry with the given ID from this store in the database. |
String |
getDetailIdColumn()
Deprecated. |
String |
getDetailKeyColumn()
Deprecated. |
String |
getDetailTable()
Deprecated. |
String |
getDetailValueColumn()
Deprecated. |
T |
getEntry(Object id)
Deprecated. returns the DBEntry based on its ID. |
ObjectRowMapper<T> |
getFlatMapper()
Deprecated. returns the embedded mapper that disregards the properties that are handled automatically by this class |
protected void |
initializeDetails(T entry)
Deprecated. |
void |
insert(T entry)
Deprecated. it is suggested to create the entry with an ID obtained through generateNewID() before passing it into
this method. |
Object |
insertAsNew(T entry)
Deprecated. inserts the given entry using an ID generated by generateNewID
while ignoring the ID of the given entry. |
protected void |
insertDetails(Object id,
T entry)
Deprecated. takes the additional ID since - as for insertAsNew - the ID may be different from the ID of the entry |
void |
update(T entry)
Deprecated. updates the given entry in the database. |
| Methods inherited from class com.antelmann.sql.JDBCRowStore |
|---|
add, checkTransaction, containsID, fetch, fetchStubs, generateNewID, getColumnNames, getColumnsForTopic, getColumnSize, getDatabase, getDisplayColumn, getDisplayNameForColumn, getEntryClass, getIDColumn, getMapper, getMappingForTopic, getSQLTypeforColumn, getStub, getTableName, getTableQuery, isFastDelete, isIgnoreInvalidProperties, remove, setFastDelete, setIgnoreInvalidProperties, size, trimIdString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DetailRowStore(Database<Connection> db,
ObjectRowMapper<T> flatMapper,
Class<T> type,
String detailTable,
String detailIdColumn,
String detailKeyColumn,
String detailValueColumn)
flatMapper - the given mapper should only be concerned with mapping
the object while disregarding the properties stored within.
Note that instead of the given mapper, an overwriting instance
is used herein, which automatically initializes the properties
when instanciate(RowItem) is called. Thus, the mapper should not
be changed anymore by an inheriting class.detailTable - the name of the table that contains the detail datadetailIdColumn - the name of the column that contains the ID that
mapps to the ID of the associated DBEntry
(this along with the detailKeyColumn ought to be the primary key)detailKeyColumn - the name of the column that contains the key for the propertydetailValueColumn - the name of the column that contains the value for the property| Method Detail |
|---|
public ObjectRowMapper<T> getFlatMapper()
protected void initializeDetails(T entry)
throws SQLException
SQLException
protected void insertDetails(Object id,
T entry)
throws SQLException
SQLException
protected void deleteDetails(Object id)
throws SQLException
SQLExceptionpublic String getDetailTable()
public String getDetailIdColumn()
public String getDetailKeyColumn()
public String getDetailValueColumn()
public T getEntry(Object id)
throws DatabaseException
DBClassStore
getEntry in interface DBClassStore<T extends PropertyEntry>getEntry in class JDBCRowStore<T extends PropertyEntry>id - the ID that is retrieved from Resource.getID()
DatabaseExceptionDBEntry.getID()
public int deleteEntries(Filter<? super T> filter)
throws DatabaseException
JDBCRowStore
deleteEntries in interface DBClassStore<T extends PropertyEntry>deleteEntries in class JDBCRowStore<T extends PropertyEntry>DatabaseExceptionSQLDirectQueryEntryFilter,
PreparedStatementEntryFilter,
SQLMapFilter,
JDBCRowStore.fastDelete
public boolean deleteEntry(Object id)
throws DatabaseException
DBClassStore
deleteEntry in interface DBClassStore<T extends PropertyEntry>deleteEntry in class JDBCRowStore<T extends PropertyEntry>DatabaseException
public Object insertAsNew(T entry)
throws DatabaseException
DBClassStoregenerateNewID
while ignoring the ID of the given entry.
With this method, the same Object (with the same ID) can be inserted
multiple times, stored with a new ID on each call; the ID creation is handled
automatically.
This is an optional feature that might not be implemented in all cases.
insertAsNew in interface DBClassStore<T extends PropertyEntry>insertAsNew in class JDBCRowStore<T extends PropertyEntry>DatabaseExceptionDBEntry.getID(),
DBClassStore.generateNewID()
public void insert(T entry)
throws DatabaseException
DBClassStoregenerateNewID() before passing it into
this method.
The ID of the entry must not already exist in the database.
insert in interface DBClassStore<T extends PropertyEntry>insert in class JDBCRowStore<T extends PropertyEntry>DatabaseExceptionDBClassStore.generateNewID()
public void update(T entry)
throws DatabaseException
DBClassStore
update in interface DBClassStore<T extends PropertyEntry>update in class JDBCRowStore<T extends PropertyEntry>DatabaseException - if the database was not able to perform the update
or it the entry didn't exist in the database before calling this method
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||