|
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.DefaultMappingInfo
public class DefaultMappingInfo
provides a default implementation for the MappingInfo interface,
making it easy to allow other objects to delegate the interface methods
to an instance of this class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.sql.ForeignKeyMappingInfo |
|---|
ForeignKeyMappingInfo.Analyzer |
| Constructor Summary | |
|---|---|
DefaultMappingInfo()
for use as a bean |
|
DefaultMappingInfo(DBClassStore<?> store)
|
|
DefaultMappingInfo(DefaultMappingInfo mi)
|
|
DefaultMappingInfo(MappingInfo mi,
Object... topics)
|
|
DefaultMappingInfo(String tableName,
String idColumn)
|
|
DefaultMappingInfo(String tableName,
String idColumn,
String displayColumn)
|
|
DefaultMappingInfo(String tableName,
String idColumn,
String displayColumn,
String tableQuery,
Connection con)
|
|
| Method Summary | |
|---|---|
void |
exportXML(OutputStream out)
exports the entire object as XML and writes it to the given Writer, so that the object can be reconstructed with importXML(InputSource). |
String[] |
getBooleanColumns()
|
String[] |
getChoosableColumns()
|
static String |
getColumnForForeignKey(ForeignKeyMappingInfo fmi,
Class<?> type)
returns the first available column (if any) that maps to the given type |
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[] |
getDateRangeColumns()
|
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 |
Filter<? super Stub<?>> |
getForeignKeyFilter(String column)
returns a filter that limits the allowed choices for the foreign key column; may be null |
Map<String,Class<? extends DBEntry>> |
getForeignKeys()
returns all columns denoting a foreign key mapped to their respective class representation, so that a component can allow to select from the respective values accordingly. |
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. |
static String |
getNameForType(int type)
a utility method that provides a String representation for an SQL-type |
String[] |
getNumberRangeColumns()
|
String[] |
getReadOnlyColumns()
|
String[] |
getRequiredColumns()
|
String[] |
getSelectedTextSearchColumns()
|
int |
getSQLTypeforColumn(String column)
allows to determine the SQL-type for a given column name |
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. |
String[] |
getTextSearchColumns()
|
HashSet<Object> |
getTopics()
creates and returns a newly created set containing topics for both: getMappingForTopic(Object) and getColumnsForTopic(Object) |
void |
importXML(InputStream source)
The object is fully reinitialized with the XML data contained in the given ImputSource, so that the object has the same state as it had during export. |
void |
setAllFrom(DefaultMappingInfo mi)
copies the properties of the given object and applies them to this instance, so that its behavior in regards to the given object can be matched to the extend that the implementing class supports that behavior. |
void |
setAllFrom(ForeignKeyMappingInfo fmi)
|
DefaultMappingInfo |
setAllTopics(Map<?,String> map)
|
void |
setBooleanColumns(String[] booleanColumns)
|
void |
setChoosableColumns(String[] chooseableColumns)
|
void |
setColumnNames(String[] columnNames)
|
void |
setColumnsForTopic(Object topic,
String... columns)
|
void |
setColumnSize(String column,
int size)
|
void |
setDateRangeColumns(String[] dateRangeColumns)
|
void |
setDisplayColumn(String column)
|
void |
setDisplayNameForColumn(String column,
String display)
|
void |
setForeignKey(String column,
Class<? extends DBEntry> c)
|
Filter<? super Stub<?>> |
setForeinKeyFilter(String column,
Filter<? super Stub<?>> filter)
|
void |
setIDColumn(String column)
|
void |
setMappingForTopic(Object topic,
String mapping)
|
void |
setNumberRangeColumns(String[] numberRangeColumns)
|
void |
setReadOnlyColumns(String... readOnlyColumns)
|
void |
setRequiredColumns(String[] requiredColumns)
|
void |
setSelectedTextSearchColumns(String[] selectedTextSearchColumns)
|
void |
setSQLTypeForColumn(String column,
int type)
|
void |
setTableName(String tableName)
|
void |
setTableQuery(String query)
|
void |
setTextSearchColumns(String[] textSearchColumns)
|
String |
toDetailedString()
provides full details of this instance in a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultMappingInfo()
public DefaultMappingInfo(String tableName,
String idColumn)
public DefaultMappingInfo(String tableName,
String idColumn,
String displayColumn)
public DefaultMappingInfo(String tableName,
String idColumn,
String displayColumn,
String tableQuery,
Connection con)
throws SQLException
SQLExceptionpublic DefaultMappingInfo(DBClassStore<?> store)
public DefaultMappingInfo(DefaultMappingInfo mi)
public DefaultMappingInfo(MappingInfo mi,
Object... topics)
| Method Detail |
|---|
public void setAllFrom(ForeignKeyMappingInfo fmi)
public void setAllFrom(DefaultMappingInfo mi)
Forgeable
setAllFrom in interface Forgeable<DefaultMappingInfo>mi - the object whose behavior is to be copied to this instancepublic static String getNameForType(int type)
Typespublic String[] getColumnNames()
MappingInfo
getColumnNames in interface MappingInfoMappingInfo.getTableName(),
MappingInfo.getTableQuery(),
MappingInfo.getIDColumn(),
MappingInfo.getDisplayColumn()public void setColumnNames(String[] columnNames)
public String getDisplayColumn()
MappingInfo
getDisplayColumn in interface MappingInfopublic void setDisplayColumn(String column)
public String getDisplayNameForColumn(String column)
MappingInfo
getDisplayNameForColumn in interface MappingInfo
public void setDisplayNameForColumn(String column,
String display)
public String getIDColumn()
MappingInfo
getIDColumn in interface MappingInfopublic void setIDColumn(String column)
public HashSet<Object> getTopics()
getMappingForTopic(Object) and getColumnsForTopic(Object)
public String getMappingForTopic(Object topic)
MappingInfo
getMappingForTopic in interface MappingInfo
public void setMappingForTopic(Object topic,
String mapping)
public DefaultMappingInfo setAllTopics(Map<?,String> map)
public String[] getColumnsForTopic(Object topic)
MappingInfo
getColumnsForTopic in interface MappingInfo
public void setColumnsForTopic(Object topic,
String... columns)
public int getSQLTypeforColumn(String column)
throws IllegalArgumentException
MappingInfo
getSQLTypeforColumn in interface MappingInfoIllegalArgumentException - if the given column is not knownTypes
public void setSQLTypeForColumn(String column,
int type)
throws IllegalArgumentException
IllegalArgumentException
public int getColumnSize(String column)
throws IllegalArgumentException
MappingInfo
getColumnSize in interface MappingInfoIllegalArgumentException - if the given column is not known
public void setColumnSize(String column,
int size)
throws IllegalArgumentException
IllegalArgumentExceptionpublic String getTableName()
MappingInfo
getTableName in interface MappingInfoMappingInfo.getTableQuery()public void setTableName(String tableName)
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()public void setTableQuery(String query)
public String[] getReadOnlyColumns()
public void setReadOnlyColumns(String... readOnlyColumns)
public String[] getBooleanColumns()
public void setBooleanColumns(String[] booleanColumns)
public String[] getChoosableColumns()
public void setChoosableColumns(String[] chooseableColumns)
public String[] getDateRangeColumns()
public void setDateRangeColumns(String[] dateRangeColumns)
public Filter<? super Stub<?>> getForeignKeyFilter(String column)
ForeignKeyMappingInfo
getForeignKeyFilter in interface ForeignKeyMappingInfoForeignKeyMappingInfo.getForeignKeys()
public Filter<? super Stub<?>> setForeinKeyFilter(String column,
Filter<? super Stub<?>> filter)
public Map<String,Class<? extends DBEntry>> getForeignKeys()
ForeignKeyMappingInfo
getForeignKeys in interface ForeignKeyMappingInfoForeignKeyMappingInfo.getForeignKeyFilter(String)
public void setForeignKey(String column,
Class<? extends DBEntry> c)
public String[] getNumberRangeColumns()
public void setNumberRangeColumns(String[] numberRangeColumns)
public String[] getRequiredColumns()
public void setRequiredColumns(String[] requiredColumns)
public String[] getSelectedTextSearchColumns()
public void setSelectedTextSearchColumns(String[] selectedTextSearchColumns)
public String[] getTextSearchColumns()
public void setTextSearchColumns(String[] textSearchColumns)
public static String getColumnForForeignKey(ForeignKeyMappingInfo fmi,
Class<?> type)
public String toDetailedString()
DetailedString
toDetailedString in interface DetailedString
public void exportXML(OutputStream out)
throws IOException
XMLSerializableimportXML(InputSource).
The given stream is neither flushed nor closed, so that other data may be
effectively written to the InputSource after the method returned.
exportXML in interface XMLSerializableIOExceptionXMLSerializable.importXML(InputStream)
public void importXML(InputStream source)
throws SAXException,
IOException,
ClassCastException
XMLSerializable
importXML in interface XMLSerializableSAXException
IOException
ClassCastExceptionXMLSerializable.exportXML(OutputStream)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||