|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.WrappedDBClassStore<T>
com.antelmann.sql.WrappedDBClassStoreMapping<T>
public class WrappedDBClassStoreMapping<T extends DBEntry>
eases the wrapping of stores that need to override certain mapping infos
DefaultMappingInfo| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.db.DBClassStore |
|---|
DBClassStore.DBMethod |
| Field Summary | |
|---|---|
protected MappingInfo |
mi
|
| Fields inherited from class com.antelmann.db.WrappedDBClassStore |
|---|
store |
| Constructor Summary | |
|---|---|
WrappedDBClassStoreMapping(DBClassStore<T> store)
the given store must directly support or wrap the MappingInfo interface |
|
WrappedDBClassStoreMapping(DBClassStore<T> store,
MappingInfo mi)
|
|
| Method Summary | |
|---|---|
void |
addColumnsForTopic(Object topic,
String... columns)
adds all given columns as applicable for the given topic |
String |
addTopicMapping(Object topic,
String mapping)
allows to define information for getMappingForTopic(Object) |
Hashtable<String,String> |
getColumnDisplayMapping()
provides direct access to the underlying data to individualize the column display information |
String[] |
getColumnNames()
returns all the columns that are retrieved by the mapper when querying the database); the column names for the ID column and display column are included in the returned array. |
String[] |
getColumnsForTopic(Object topic)
allows to determine whether there are any columns that are applicable for the given topic |
int |
getColumnSize(String column)
allows to determine the size of the given column name. |
String |
getDisplayColumn()
for use in stubs (in case a single column is used as a display value) |
String |
getDisplayNameForColumn(String column)
returns a name suitable for display in a GUI if different from the column name used in the database |
String |
getIDColumn()
specifies the column where the ID of the entry is mapped to |
String |
getMappingForTopic(Object topic)
allows to determine whether a specific given topic maps to a distinct table, query or column name. |
int |
getSQLTypeforColumn(String column)
allows to determine the SQL-type for a given column name |
String[] |
getSupportedTopicColumns()
returns all topics supported by getColumnsForTopic(Object) |
String |
getTableName()
provides the name of the table that stores the data for the store |
String |
getTableQuery()
if querying involves something different than just selecting all columns of the table, this method returns the string used to replace the table name in a query. |
ArrayList<String> |
removeColumnTopics(Object topic)
removes all columns from the mapping for the given topic |
String |
removeTopicMapping(Object topic)
|
void |
setColumnsForTopic(Object topic,
String... columns)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final MappingInfo mi
| Constructor Detail |
|---|
public WrappedDBClassStoreMapping(DBClassStore<T> store)
public WrappedDBClassStoreMapping(DBClassStore<T> store,
MappingInfo mi)
| Method Detail |
|---|
public String addTopicMapping(Object topic,
String mapping)
getMappingForTopic(Object)
mapping - if null, the given topic is removed from the map
getMappingForTopic(Object)public String removeTopicMapping(Object topic)
public ArrayList<String> removeColumnTopics(Object topic)
getColumnsForTopic(Object)
public void setColumnsForTopic(Object topic,
String... columns)
public void addColumnsForTopic(Object topic,
String... columns)
getColumnsForTopic(Object)public Hashtable<String,String> getColumnDisplayMapping()
getDisplayNameForColumn(String)public String[] getColumnNames()
MappingInfo
getColumnNames in interface MappingInfoMappingInfo.getTableName(),
MappingInfo.getTableQuery(),
MappingInfo.getIDColumn(),
MappingInfo.getDisplayColumn()public String[] getSupportedTopicColumns()
getColumnsForTopic(Object)
public String[] getColumnsForTopic(Object topic)
MappingInfo
getColumnsForTopic in interface MappingInfo
public int getColumnSize(String column)
throws IllegalArgumentException
MappingInfo
getColumnSize in interface MappingInfoIllegalArgumentException - if the given column is not knownpublic String getDisplayColumn()
MappingInfo
getDisplayColumn in interface MappingInfopublic String getDisplayNameForColumn(String column)
MappingInfo
getDisplayNameForColumn in interface MappingInfopublic String getIDColumn()
MappingInfo
getIDColumn in interface MappingInfopublic String getMappingForTopic(Object topic)
MappingInfo
getMappingForTopic in interface MappingInfo
public int getSQLTypeforColumn(String column)
throws IllegalArgumentException
MappingInfo
getSQLTypeforColumn in interface MappingInfoIllegalArgumentException - if the given column is not knownTypespublic String getTableName()
MappingInfo
getTableName in interface MappingInfoMappingInfo.getTableQuery()public String getTableQuery()
MappingInfoMappingInfo.getTableName() is used in all cases.
If non-null, this variable would have a value like '(select a.field1, b.* from a, b where a.id=b.id) as t1'.
getTableQuery in interface MappingInfoMappingInfo.getTableName()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||