Package org.eclipse.emf.cdo.server.db.mapping

# Class DelegatingTypeMapping

java.lang.Object
org.eclipse.emf.cdo.server.db.mapping.DelegatingTypeMapping

All Implemented Interfaces:
  `IFeatureMapping`, `ILobRefsUpdater`, `ITypeMapping`

public abstract class DelegatingTypeMapping extends Object implements ITypeMapping, ILobRefsUpdater

Since:
  4.10
Author:
  Eike Stepper

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.db.mapping.ILobRefsUpdater

`ILobRefsUpdater.LobRefsUpdateNotSupportedException`

## Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.db.mapping.ITypeMapping

`ITypeMapping.Descriptor, ITypeMapping.Factory, ITypeMapping.Provider, ITypeMapping.Registry`

## Constructor Summary

Constructors
Constructor
Description
`DelegatingTypeMapping()`

## Method Summary

Modifier and Type
Method
Description
`void`
`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`
`decode(Object value)`
`protected Object`
`encode(Object value)`
`org.eclipse.net4j.db.DBType`
`getDBType()`
`abstract AbstractTypeMapping`
`getDelegate()`
`EStructuralFeature`
`getFeature()`
`org.eclipse.net4j.db.ddl.IDBField`
`getField()`
`ITypeMapping`
`getTypeMapping()`
`Object`
`readValue(ResultSet resultSet)`
Read the value from a `ResultSet` and convert it from the DB to the CDO representation.
`void`
`readValueToRevision(ResultSet resultSet, InternalCDORevision revision)`
Read a value from a `ResultSet`, 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 JDBC `IDBPreparedStatement` using an appropriate `setXxx` method.
`void`
`setFeature(EStructuralFeature feature)`
`void`
`setMappingStrategy(IMappingStrategy mappingStrategy)`
`void`
`setValue(PreparedStatement stmt, int index, Object value)`
Set the given value to the JDBC `IDBPreparedStatement` using an appropriate `setXxx` method.
`void`
`setValueFromRevision(PreparedStatement stmt, int index, InternalCDORevision revision)`
Set a value of the given revision to the JDBC `IDBPreparedStatement` using an appropriate `setXxx` method.
`void`
`updateLobRefs(Connection connection)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DelegatingTypeMapping

public DelegatingTypeMapping()

## Method Details

### getDelegate

public abstract AbstractTypeMapping getDelegate()

### getFeature

public EStructuralFeature getFeature()

Specified by:
  `getFeature` in interface `IFeatureMapping`
Specified by:
  `getFeature` in interface `ITypeMapping`
Returns:
  The feature which is associated with this mapping.

### getTypeMapping

public ITypeMapping getTypeMapping()

Specified by:
  `getTypeMapping` in interface `IFeatureMapping`
Specified by:
  `getTypeMapping` in interface `ITypeMapping`
Returns:
  The type mapping which is used for this feature mapping.
Since:
  4.14

### getField

public org.eclipse.net4j.db.ddl.IDBField getField()

Specified by:
  `getField` in interface `IFeatureMapping`
Specified by:
  `getField` in interface `ITypeMapping`
Returns:
  The db field which is associated with this mapping.

### getDBType

public org.eclipse.net4j.db.DBType getDBType()

Specified by:
  `getDBType` in interface `IFeatureMapping`
Specified by:
  `getDBType` in interface `ITypeMapping`
Returns:
  The db type which is associated with this mapping.

### setMappingStrategy

public void setMappingStrategy(IMappingStrategy mappingStrategy)

Specified by:
  `setMappingStrategy` in interface `ITypeMapping`

### setFeature

public void setFeature(EStructuralFeature feature)

Specified by:
  `setFeature` in interface `ITypeMapping`

### setDBType

public void setDBType(org.eclipse.net4j.db.DBType dbType)

Specified by:
  `setDBType` in interface `ITypeMapping`

### createDBField

public void createDBField(org.eclipse.net4j.db.ddl.IDBTable table)

Specified by:
  `createDBField` in interface `ITypeMapping`

### createDBField

public void createDBField(org.eclipse.net4j.db.ddl.IDBTable table, String fieldName)
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 interface `ITypeMapping`
Parameters:
  `table` - the table to add this field to.
  `fieldName` - the name for the DBField.

### setDBField

public void setDBField(org.eclipse.net4j.db.ddl.IDBTable table, String fieldName)
Description copied from interface: `ITypeMapping`
Sets the DBField. The name of the DBField is explicitly determined by the corresponding parameter.

Specified by:
  `setDBField` in interface `ITypeMapping`
Parameters:
  `table` - the table to add this field to.
  `fieldName` - the name for the DBField.

### setValue

public void setValue(PreparedStatement stmt, int index, Object value) throws SQLException
Description copied from interface: `ITypeMapping`
Set the given value to the JDBC `IDBPreparedStatement` using an appropriate `setXxx` method.

Specified by:
  `setValue` in interface `ITypeMapping`
Parameters:
  `stmt` - the prepared statement to set the value
  `index` - the index to use for the `setXxx` method.
  `value` - the value to set.
Throws:
  `SQLException` - if the `setXxx` throws it.

### setDefaultValue

public void setDefaultValue(PreparedStatement stmt, int index) throws SQLException
Description copied from interface: `ITypeMapping`
Set the feature's default value to the JDBC `IDBPreparedStatement` using an appropriate `setXxx` method.

Specified by:
  `setDefaultValue` in interface `ITypeMapping`
Parameters:
  `stmt` - the prepared statement to set the value
  `index` - the index to use for the `setXxx` method.
Throws:
  `SQLException` - if the `setXxx` 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 JDBC `IDBPreparedStatement` using an appropriate `setXxx` method. The feature from which the value is taken is determined by `ITypeMapping.getFeature()`.

Specified by:
  `setValueFromRevision` in interface `ITypeMapping`
Parameters:
  `stmt` - the prepared statement to set the value
  `index` - the index to use for the `setXxx` method.
  `revision` - the revision to get the value to set from.
Throws:
  `SQLException` - if the `setXxx` throws it.

### readValue

public Object readValue(ResultSet resultSet) throws SQLException
Description copied from interface: `ITypeMapping`
Read the value from a `ResultSet` and convert it from the DB to the CDO representation. The resultSet field to read from is determined automatically by the internal `ITypeMapping.getField()` name.

Specified by:
  `readValue` in interface `ITypeMapping`
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 a `ResultSet`, 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 internal `ITypeMapping.getField()` name.

Specified by:
  `readValueToRevision` in interface `ITypeMapping`
Parameters:
  `resultSet` - the result set to read from
  `revision` - the revision to which the value should be set.
Throws:
  `SQLException` - if reading the value throws an SQLException

### updateLobRefs

public void updateLobRefs(Connection connection)

Specified by:
  `updateLobRefs` in interface `ILobRefsUpdater`

### encode

protected Object encode(Object value)

### decode

protected Object decode(Object value)