Class DelegatingTypeMapping
java.lang.Object
org.eclipse.emf.cdo.server.db.mapping.DelegatingTypeMapping
- All Implemented Interfaces:
ITypeMapping
- Since:
- 4.10
- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.db.mapping.ITypeMapping
ITypeMapping.Descriptor, ITypeMapping.Factory, ITypeMapping.Provider, ITypeMapping.Registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createDBField
(org.eclipse.net4j.db.ddl.IDBTable table) void
createDBField
(org.eclipse.net4j.db.ddl.IDBTable table, String fieldName) Creates the DBField and adds it to the given table.protected Object
protected Object
org.eclipse.net4j.db.DBType
abstract AbstractTypeMapping
org.eclipse.net4j.db.ddl.IDBField
getField()
Read the value from aResultSet
and convert it from the DB to the CDO representation.void
readValueToRevision
(ResultSet resultSet, InternalCDORevision revision) Read a value from aResultSet
, convert it from the DB to the CDO representation and set it to the feature of the revision.void
setDBField
(org.eclipse.net4j.db.ddl.IDBTable table, String fieldName) Sets the DBField.void
setDBType
(org.eclipse.net4j.db.DBType dbType) void
setDefaultValue
(PreparedStatement stmt, int index) Set the feature's default value to the JDBCIDBPreparedStatement
using an appropriatesetXxx
method.void
setFeature
(EStructuralFeature feature) void
setMappingStrategy
(IMappingStrategy mappingStrategy) void
setValue
(PreparedStatement stmt, int index, Object value) Set the given value to the JDBCIDBPreparedStatement
using an appropriatesetXxx
method.void
setValueFromRevision
(PreparedStatement stmt, int index, InternalCDORevision revision) Set a value of the given revision to the JDBCIDBPreparedStatement
using an appropriatesetXxx
method.
-
Constructor Details
-
DelegatingTypeMapping
public DelegatingTypeMapping()
-
-
Method Details
-
getDelegate
-
getFeature
- Specified by:
getFeature
in interfaceITypeMapping
- Returns:
- The feature which is associated with this mapping.
-
getField
public org.eclipse.net4j.db.ddl.IDBField getField()- Specified by:
getField
in interfaceITypeMapping
- Returns:
- The db field which is associated with this mapping.
-
getDBType
public org.eclipse.net4j.db.DBType getDBType()- Specified by:
getDBType
in interfaceITypeMapping
- Returns:
- The db type which is associated with this mapping.
-
setMappingStrategy
- Specified by:
setMappingStrategy
in interfaceITypeMapping
-
setFeature
- Specified by:
setFeature
in interfaceITypeMapping
-
setDBType
public void setDBType(org.eclipse.net4j.db.DBType dbType) - Specified by:
setDBType
in interfaceITypeMapping
-
createDBField
public void createDBField(org.eclipse.net4j.db.ddl.IDBTable table) - Specified by:
createDBField
in interfaceITypeMapping
-
createDBField
Description copied from interface:ITypeMapping
Creates the DBField and adds it to the given table. The name of the DBField is explicitly determined by the corresponding parameter.- Specified by:
createDBField
in interfaceITypeMapping
- Parameters:
table
- the table to add this field to.fieldName
- the name for the DBField.
-
setDBField
Description copied from interface:ITypeMapping
Sets the DBField. The name of the DBField is explicitly determined by the corresponding parameter.- Specified by:
setDBField
in interfaceITypeMapping
- Parameters:
table
- the table to add this field to.fieldName
- the name for the DBField.
-
setValue
Description copied from interface:ITypeMapping
Set the given value to the JDBCIDBPreparedStatement
using an appropriatesetXxx
method.- Specified by:
setValue
in interfaceITypeMapping
- Parameters:
stmt
- the prepared statement to set the valueindex
- the index to use for thesetXxx
method.value
- the value to set.- Throws:
SQLException
- if thesetXxx
throws it.
-
setDefaultValue
Description copied from interface:ITypeMapping
Set the feature's default value to the JDBCIDBPreparedStatement
using an appropriatesetXxx
method.- Specified by:
setDefaultValue
in interfaceITypeMapping
- Parameters:
stmt
- the prepared statement to set the valueindex
- the index to use for thesetXxx
method.- Throws:
SQLException
- if thesetXxx
throws it.
-
setValueFromRevision
public void setValueFromRevision(PreparedStatement stmt, int index, InternalCDORevision revision) throws SQLException Description copied from interface:ITypeMapping
Set a value of the given revision to the JDBCIDBPreparedStatement
using an appropriatesetXxx
method. The feature from which the value is taken is determined byITypeMapping.getFeature()
.- Specified by:
setValueFromRevision
in interfaceITypeMapping
- Parameters:
stmt
- the prepared statement to set the valueindex
- the index to use for thesetXxx
method.revision
- the revision to get the value to set from.- Throws:
SQLException
- if thesetXxx
throws it.
-
readValue
Description copied from interface:ITypeMapping
Read the value from aResultSet
and convert it from the DB to the CDO representation. The resultSet field to read from is determined automatically by the internalITypeMapping.getField()
name.- Specified by:
readValue
in interfaceITypeMapping
- Parameters:
resultSet
- the result set to read from- Returns:
- the read value
- Throws:
SQLException
- if reading the value throws an SQLException
-
readValueToRevision
public void readValueToRevision(ResultSet resultSet, InternalCDORevision revision) throws SQLException Description copied from interface:ITypeMapping
Read a value from aResultSet
, convert it from the DB to the CDO representation and set it to the feature of the revision. The feature is determined by getFeature() The resultSet field to read from is determined automatically by the internalITypeMapping.getField()
name.- Specified by:
readValueToRevision
in interfaceITypeMapping
- Parameters:
resultSet
- the result set to read fromrevision
- the revision to which the value should be set.- Throws:
SQLException
- if reading the value throws an SQLException
-
encode
-
decode
-