|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping
org.compass.gps.device.jdbc.mapping.TableToResourceMapping
public class TableToResourceMapping
A specialized form of
ResultSetToResourceMapping,
mapping a specfic database table to a resource.
Since the mapping works against a table, most of the parameters can be automatically generated. The required mappings are the alias name and the table name. The settings that can be generated are the id mappings (based on the table primary keys), the select query (based on the table name), and the version query (based on the table name and the version column mappings).
If no data column mappings are provided, the
indexUnMappedColumns from
ResultSetToResourceMapping can be
user to auto map all the table columns as data columns.
For real time mirroring, at least one version column mapping (VersionColumnMapping)
is required. And the version query can be auto generated.
Note that the mapping will auto generate only settings that have not been set. If, for example, the select query was set, it will not be generated.
| Constructor Summary | |
|---|---|
TableToResourceMapping()
Creates a new table to Resource mapping. |
|
TableToResourceMapping(String tableName,
String alias)
Creates a new table to Resource mapping with the given
table name and alias. |
|
| Method Summary | |
|---|---|
void |
generateMappings(DataSource dataSource)
Generates the unset mappings. |
String |
getTableName()
Returns the table name that the mappings maps to. |
void |
setTableName(String tableName)
Sets the table name that the mappings maps to. |
String |
toString()
|
| Methods inherited from class org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping |
|---|
addDataMapping, addIdMapping, addVersionMapping, dataMappingsIt, dataMappingsSize, getAlias, getMappingsForColumn, getMappingsForColumn, getSelectQuery, getVersionQuery, idMappingsIt, idMappingsSize, isIndexUnMappedColumns, mappingsIt, setAlias, setDataMappings, setIdMappings, setIndexUnMappedColumns, setSelectQuery, setVersionMappings, setVersionQuery, supportsVersioning, versionMappingsIt, versionMappingsSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TableToResourceMapping()
Resource mapping. Must set the
alias, and the table name.
Indexing of unmapped columns is diasabled by default.
public TableToResourceMapping(String tableName,
String alias)
Resource mapping with the given
table name and alias.
Indexing of unmapped columns is disabled by default.
tableName - The table namealias - The Resource alias| Method Detail |
|---|
public void generateMappings(DataSource dataSource)
throws JdbcGpsDeviceException
Generates the id mappings based on the table primary keys if no id column mappings are set.
Generates the select query based on the table name if no select query is set.
Generates the version query based on the table name and the version column mappings if no version query is set and at least one version column mapping is set.
generateMappings in interface AutoGenerateMappingJdbcGpsDeviceExceptionpublic String getTableName()
public void setTableName(String tableName)
public String toString()
toString in class ResultSetToResourceMapping
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||