|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.compass.gps.device.jdbc.mapping.AbstractColumnMapping
org.compass.gps.device.jdbc.mapping.AbstractColumnToPropertyMapping
org.compass.gps.device.jdbc.mapping.AbstractConstantColumnToPropertyMapping
org.compass.gps.device.jdbc.mapping.IdColumnToPropertyMapping
public class IdColumnToPropertyMapping
Maps an id column to Resource Property
. The id column is the column that identifies
or is part of columns that identifies the ResultSet
. In a
table, it is the table primary keys.
The PropertyIndex
is Property.Index.UN_TOKENIZED
.
the PropertyStore
is Property.Store.YES
, the
PropertyTermVector
is Property.TermVector.NO
and the Boost
is 1.0f
.
The id mapping also holds an additional mapping, the
columnNameForVersion
mapping. When performing the mirror
operation (if enabled), it is the id column name that is added to the select
query in order to filter by the specified ids. For example, if the select
query is (for a PARENT and CHILD table relationship):
select p.id as parent_id, p.first_name as parent_first_name, p.last_name as parent_last_name, p.version as parent_version, COALESCE(c.id, 0) as child_id, c.first_name as child_first_name, c.last_name child_last_name, COALESCE(c.version, 0) as child_version from parent p left join child c on p.id = c.parent_id
than when performing the query to get the values for certain values of ids
(the parent and child ids), the column names that will be used are:
p.id
and COALESCE(c.id, 0)
. And the actual
where clause will be: where p.id = ? and COALESCE(c.id, 0) = ?
.
Note, that the id column name is parent_id
, and
child_id
. They are used for reading the id values, not
constructing queries.
Constructor Summary | |
---|---|
IdColumnToPropertyMapping()
Creates an empty id column to property mapping. |
|
IdColumnToPropertyMapping(int columnIndex,
String propertyName)
Creates a new Id Column to property mapping given the column index and the property name. |
|
IdColumnToPropertyMapping(int columnIndex,
String propertyName,
String columnNameForVersion)
Creates a new Id Column to property mapping given the column index, the property name, and the column name for the versioning (the mirror operation). |
|
IdColumnToPropertyMapping(String columnName,
String propertyName)
Creates a new Id column to propery mapping given the column name and the property name. |
|
IdColumnToPropertyMapping(String columnName,
String propertyName,
String columnNameForVersion)
Creates a new Id column to property mapping given the column name, the property name, and the column name for the versioning (the mirror operation). |
Method Summary | |
---|---|
String |
getColumnNameForVersion()
Returns the id column name that will be used in the dynamically created where clause with the original select query. |
void |
setColumnNameForVersion(String columnNameForVersion)
Sets the id column name that will be used in the dynamically created where clause with the original select query. |
Methods inherited from class org.compass.gps.device.jdbc.mapping.AbstractConstantColumnToPropertyMapping |
---|
getBoost, getPropertyIndex, getPropertyStore, getPropertyTermVector |
Methods inherited from class org.compass.gps.device.jdbc.mapping.AbstractColumnToPropertyMapping |
---|
getAnalyzer, getConverter, getExcludeFromAll, getPropertyName, setAnalyzer, setConverter, setExcludeFromAll, setPropertyName, toString |
Methods inherited from class org.compass.gps.device.jdbc.mapping.AbstractColumnMapping |
---|
getColumnIndex, getColumnName, isUsingColumnIndex, setColumnIndex, setColumnName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.compass.gps.device.jdbc.mapping.ColumnMapping |
---|
getColumnIndex, getColumnName, isUsingColumnIndex |
Constructor Detail |
---|
public IdColumnToPropertyMapping()
public IdColumnToPropertyMapping(String columnName, String propertyName)
columnNameForVersion
value.
columnName
- The id column name that will be used to look up the id value
(also acts as the columnNameForVersion).propertyName
- The Compass Resource Property
name.public IdColumnToPropertyMapping(String columnName, String propertyName, String columnNameForVersion)
columnName
- The id column name that will be used to look up the id value.propertyName
- The Compass Resource Property
name.columnNameForVersion
- The id column name that will be used in the dynamically
created where clause with the original select query.public IdColumnToPropertyMapping(int columnIndex, String propertyName)
columnIndex
- The id column index that will be used to look up the id value.propertyName
- The Compass Resource Property
name.public IdColumnToPropertyMapping(int columnIndex, String propertyName, String columnNameForVersion)
columnIndex
- The id column index that will be used to look up the id value.propertyName
- The Compass Resource Property
name.columnNameForVersion
- The id column name that will be used in the dynamically
created where clause with the original select query.Method Detail |
---|
public String getColumnNameForVersion()
public void setColumnNameForVersion(String columnNameForVersion)
columnNameForVersion
- The id column name that will be used in the dynamically
created where clause with the original select query.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |