org.compass.gps.device.jdbc.mapping
Class VersionColumnMapping

java.lang.Object
  extended by org.compass.gps.device.jdbc.mapping.AbstractColumnMapping
      extended by org.compass.gps.device.jdbc.mapping.VersionColumnMapping
All Implemented Interfaces:
ColumnMapping

public class VersionColumnMapping
extends AbstractColumnMapping

Maps a version column (no property mapping required - if you wish to map the version colum to a Resource Property use the DataColumnToPropertyMapping).

In order to map a version column, either the column index or the column name must be set, and the version column jdbc type (one of java.sql.Types). The version column jdbc type defaults to java.sql.Types.BIGINT.

Note that ResultSetJdbcGpsDevice defaults to automatically detect and assign the version column sql type.

Author:
kimchy

Constructor Summary
VersionColumnMapping()
          Creates an empty version column mapping.
VersionColumnMapping(int columnIndex)
          Creates a new version column mapping given the column name.
VersionColumnMapping(int columnIndex, int sqlType)
          Creates a new version column mapping given the column index and the column sql type.
VersionColumnMapping(String columnName)
          Creates a new version column mapping given the column name.
VersionColumnMapping(String columnName, int sqlType)
          Creates a new version column mapping given the column name and the column sql type.
 
Method Summary
 int getSqlType()
          Returns the jdbc sql type of the version column.
 void setSqlType(int sqlType)
          Sets the jdbc sql type of the version column.
 
Methods inherited from class org.compass.gps.device.jdbc.mapping.AbstractColumnMapping
getColumnIndex, getColumnName, isUsingColumnIndex, setColumnIndex, setColumnName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionColumnMapping

public VersionColumnMapping()
Creates an empty version column mapping. Must set at least the colum index or colum name.

The sqlType defaults to java.sql.Types.BIGINT.


VersionColumnMapping

public VersionColumnMapping(String columnName)
Creates a new version column mapping given the column name.

The sqlType defaults to java.sql.Types.BIGINT.

Parameters:
columnName - The version column name that will be used to look up the column value.

VersionColumnMapping

public VersionColumnMapping(int columnIndex)
Creates a new version column mapping given the column name.

The sqlType defaults to java.sql.Types.BIGINT.

Parameters:
columnIndex - The version column name that will be used to look up the column value.

VersionColumnMapping

public VersionColumnMapping(String columnName,
                            int sqlType)
Creates a new version column mapping given the column name and the column sql type.

Parameters:
columnName - The version column name that will be used to look up the column value.
sqlType - The sql type (java.sql.Types) of the version column.

VersionColumnMapping

public VersionColumnMapping(int columnIndex,
                            int sqlType)
Creates a new version column mapping given the column index and the column sql type.

Parameters:
columnIndex - The version column name that will be used to look up the column value.
sqlType - The sql type (java.sql.Types) of the version column.
Method Detail

getSqlType

public int getSqlType()
Returns the jdbc sql type of the version column. Should be one of java.sql.Types.

Returns:
The jdbc sql type of the version column.

setSqlType

public void setSqlType(int sqlType)
Sets the jdbc sql type of the version column. Should be one of java.sql.Types.

Parameters:
sqlType - The jdbc sql type of the version column.


Copyright (c) 2004-2008 The Compass Project.