|
||||||||||
| 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
public class ResultSetToResourceMapping
Maps a Jdbc ResultSet to a Compass Resource.
The required mappings are the alias of the Resource, the
select query that generates the ResultSet, and at least one
id mapping that maps the ResultSet identifiers columns (IdColumnToPropertyMapping).
Mapping data columns (DataColumnToPropertyMapping)
is optional, but provides the meta data (Resource Proeprty)
for searching. You can also enable (which is disabled by default) for
indexing all the un mapped columns of the ResultSet using the
setIndexUnMappedColumns(boolean).
For real time mirroring, the version query and at least one version column
mapping (VersionColumnMapping)
is required.
| Constructor Summary | |
|---|---|
ResultSetToResourceMapping()
Creates a new ResultSet to Resource
mapping. |
|
ResultSetToResourceMapping(String alias,
String selectQuery)
Creates a new ResultSet to Resource mapping
using the supplied alias and select query. |
|
ResultSetToResourceMapping(String alias,
String selectQuery,
ColumnToPropertyMapping idMapping)
Creates a new ResultSet to Resource mapping
using the supplied alias and select query and one id column mapping. |
|
| Method Summary | |
|---|---|
void |
addDataMapping(ColumnToPropertyMapping dataMapping)
Adds data column mapping. |
void |
addIdMapping(ColumnToPropertyMapping idMapping)
Adds id column mapping. |
void |
addVersionMapping(VersionColumnMapping versionColumnMapping)
Adds version column mapping for real time mirror data changes. |
Iterator |
dataMappingsIt()
Returns an iterator over the data mappings. |
int |
dataMappingsSize()
Returns the size of the data mappings. |
String |
getAlias()
Returns the alias of the mapped Resource. |
List |
getMappingsForColumn(int columnIndex)
Returns a list of all the ColumnMappings that are mapped to the
column index. |
List |
getMappingsForColumn(String columnName)
Returns a list of all the ColumnMappings that are mapped to the
column name. |
String |
getSelectQuery()
Returns the select query that generates the ResultSet. |
String |
getVersionQuery()
Returns the version query that is used for real time mirror data changes. |
Iterator |
idMappingsIt()
Returns an iterator over the id mappings. |
int |
idMappingsSize()
Returns the size of the id mappings. |
boolean |
isIndexUnMappedColumns()
Should the mapping index unmapped columns as data columns. |
Iterator |
mappingsIt()
|
void |
setAlias(String alias)
Sets the alias of the mapped Resource. |
void |
setDataMappings(ColumnToPropertyMapping[] dataMappingsArr)
Adds of array of ColumnToPropertyMappings which acts as the data
column mappings. |
void |
setIdMappings(ColumnToPropertyMapping[] idMappingsArr)
Adds the array of ColumnToPropertyMappings which acts as the id
column mappings. |
void |
setIndexUnMappedColumns(boolean indexUnMappedColumns)
Returns if the mapping should set to index unmapped columns as data columns. |
void |
setSelectQuery(String selectQuery)
Sets the select query that generates the ResultSet. |
void |
setVersionMappings(VersionColumnMapping[] versionColumnMappingsArr)
Adds an array of ColumnToPropertyMappings which acts as the
version column mappings. |
void |
setVersionQuery(String snapshotQuery)
Sets the version query that is used for real time mirror data changes. |
boolean |
supportsVersioning()
Is the mapping support versioning. |
String |
toString()
|
Iterator |
versionMappingsIt()
Returns an iterator of the version mappings. |
int |
versionMappingsSize()
Returns the size of the version mappings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResultSetToResourceMapping()
ResultSet to Resource
mapping. Must set at least the alias, the select query, and at lease one
id mapping.
Indexing of unmapped columns is diasabled by default.
public ResultSetToResourceMapping(String alias,
String selectQuery)
ResultSet to Resource mapping
using the supplied alias and select query. At least one id mapping is
required to be configured as well.
Indexing of unmapped columns is diasabled by default.
alias - The alias of the mapped Resource.selectQuery - The select query that generates teh ResultSet.
public ResultSetToResourceMapping(String alias,
String selectQuery,
ColumnToPropertyMapping idMapping)
ResultSet to Resource mapping
using the supplied alias and select query and one id column mapping.
If additional id column mappings are required, use
addIdMapping(ColumnToPropertyMapping) to add them.
Indexing of unmapped columns is diasabled by default.
alias - The alias of the mapped Resource.selectQuery - The select query that generates teh ResultSet.idMapping - Id mapping used to map an id column.| Method Detail |
|---|
public String getAlias()
Resource.
public void setAlias(String alias)
Resource.
public String getSelectQuery()
ResultSet.
public void setSelectQuery(String selectQuery)
ResultSet.
public String getVersionQuery()
public void setVersionQuery(String snapshotQuery)
public void addIdMapping(ColumnToPropertyMapping idMapping)
public void addDataMapping(ColumnToPropertyMapping dataMapping)
public void addVersionMapping(VersionColumnMapping versionColumnMapping)
public List getMappingsForColumn(String columnName)
ColumnMappings that are mapped to the
column name.
columnName - The column name for the mapped columns.
ColumnMappings.public List getMappingsForColumn(int columnIndex)
ColumnMappings that are mapped to the
column index.
columnIndex - The column index for the mapped columns.
ColumnMappings.public void setIdMappings(ColumnToPropertyMapping[] idMappingsArr)
ColumnToPropertyMappings which acts as the id
column mappings.
idMappingsArr - An array of ColumnToPropertyMappings to add.public void setDataMappings(ColumnToPropertyMapping[] dataMappingsArr)
ColumnToPropertyMappings which acts as the data
column mappings.
dataMappingsArr - An array of ColumnToPropertyMappings to add.public void setVersionMappings(VersionColumnMapping[] versionColumnMappingsArr)
ColumnToPropertyMappings which acts as the
version column mappings.
versionColumnMappingsArr - An array of ColumnToPropertyMappings to add.public Iterator idMappingsIt()
public int idMappingsSize()
public Iterator dataMappingsIt()
public int dataMappingsSize()
public Iterator versionMappingsIt()
public int versionMappingsSize()
public Iterator mappingsIt()
public boolean isIndexUnMappedColumns()
public void setIndexUnMappedColumns(boolean indexUnMappedColumns)
public boolean supportsVersioning()
false if no version column mapping are set.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||