Interface ITypeMapping
- 
- All Known Implementing Classes:
- AbstractTypeMapping,- DelegatingTypeMapping
 
 public interface ITypeMappingMapping of single values to and from the database.- Since:
- 2.0
- Author:
- Eike Stepper, Stefan Winkler
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceITypeMapping.DescriptorA descriptor which describes one type mapping class.static interfaceITypeMapping.FactoryA factory for typeMappings.static interfaceITypeMapping.ProviderA provider for type mapping information.static interfaceITypeMapping.RegistryA global (singleton) registry which collects all available type mappings which are either available in the CDO core, as declared extensions, or registered manually.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidcreateDBField(org.eclipse.net4j.db.ddl.IDBTable table)Deprecated.As of 4.2 usecreateDBField(IDBTable, String).voidcreateDBField(org.eclipse.net4j.db.ddl.IDBTable table, java.lang.String fieldName)Creates the DBField and adds it to the given table.org.eclipse.net4j.db.DBTypegetDBType()org.eclipse.emf.ecore.EStructuralFeaturegetFeature()org.eclipse.net4j.db.ddl.IDBFieldgetField()java.lang.ObjectreadValue(java.sql.ResultSet resultSet)Read the value from aResultSetand convert it from the DB to the CDO representation.voidreadValueToRevision(java.sql.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.voidsetDBField(org.eclipse.net4j.db.ddl.IDBTable table, java.lang.String fieldName)Sets the DBField.voidsetDBType(org.eclipse.net4j.db.DBType dbType)voidsetDefaultValue(java.sql.PreparedStatement stmt, int index)Set the feature's default value to the JDBCIDBPreparedStatementusing an appropriatesetXxxmethod.voidsetFeature(org.eclipse.emf.ecore.EStructuralFeature feature)voidsetMappingStrategy(IMappingStrategy mappingStrategy)voidsetValue(java.sql.PreparedStatement stmt, int index, java.lang.Object value)Set the given value to the JDBCIDBPreparedStatementusing an appropriatesetXxxmethod.voidsetValueFromRevision(java.sql.PreparedStatement stmt, int index, InternalCDORevision value)Set a value of the given revision to the JDBCIDBPreparedStatementusing an appropriatesetXxxmethod.
 
- 
- 
- 
Method Detail- 
getFeatureorg.eclipse.emf.ecore.EStructuralFeature getFeature() - Returns:
- The feature which is associated with this mapping.
 
 - 
getFieldorg.eclipse.net4j.db.ddl.IDBField getField() - Returns:
- The db field which is associated with this mapping.
 
 - 
getDBTypeorg.eclipse.net4j.db.DBType getDBType() - Returns:
- The db type which is associated with this mapping.
- Since:
- 3.0
 
 - 
setMappingStrategyvoid setMappingStrategy(IMappingStrategy mappingStrategy) - Since:
- 4.0
 
 - 
setFeaturevoid setFeature(org.eclipse.emf.ecore.EStructuralFeature feature) - Since:
- 4.0
 
 - 
setDBTypevoid setDBType(org.eclipse.net4j.db.DBType dbType) - Since:
- 4.0
 
 - 
createDBField@Deprecated void createDBField(org.eclipse.net4j.db.ddl.IDBTable table) Deprecated.As of 4.2 usecreateDBField(IDBTable, String).
 - 
createDBFieldvoid createDBField(org.eclipse.net4j.db.ddl.IDBTable table, java.lang.String fieldName)Creates the DBField and adds it to the given table. The name of the DBField is explicitly determined by the corresponding parameter.- Parameters:
- table- the table to add this field to.
- fieldName- the name for the DBField.
 
 - 
setDBFieldvoid setDBField(org.eclipse.net4j.db.ddl.IDBTable table, java.lang.String fieldName)Sets the DBField. The name of the DBField is explicitly determined by the corresponding parameter.- Parameters:
- table- the table to add this field to.
- fieldName- the name for the DBField.
- Since:
- 3.0
 
 - 
setValuevoid setValue(java.sql.PreparedStatement stmt, int index, java.lang.Object value) throws java.sql.SQLExceptionSet the given value to the JDBCIDBPreparedStatementusing an appropriatesetXxxmethod.- Parameters:
- stmt- the prepared statement to set the value
- index- the index to use for the- setXxxmethod.
- value- the value to set.
- Throws:
- java.sql.SQLException- if the- setXxxthrows it.
 
 - 
setDefaultValuevoid setDefaultValue(java.sql.PreparedStatement stmt, int index) throws java.sql.SQLExceptionSet the feature's default value to the JDBCIDBPreparedStatementusing an appropriatesetXxxmethod.- Parameters:
- stmt- the prepared statement to set the value
- index- the index to use for the- setXxxmethod.
- Throws:
- java.sql.SQLException- if the- setXxxthrows it.
- Since:
- 3.0
 
 - 
setValueFromRevisionvoid setValueFromRevision(java.sql.PreparedStatement stmt, int index, InternalCDORevision value) throws java.sql.SQLExceptionSet a value of the given revision to the JDBCIDBPreparedStatementusing an appropriatesetXxxmethod. The feature from which the value is taken is determined bygetFeature().- Parameters:
- stmt- the prepared statement to set the value
- index- the index to use for the- setXxxmethod.
- value- the revision to get the value to set from.
- Throws:
- java.sql.SQLException- if the- setXxxthrows it.
 
 - 
readValuejava.lang.Object readValue(java.sql.ResultSet resultSet) throws java.sql.SQLExceptionRead the value from aResultSetand convert it from the DB to the CDO representation. The resultSet field to read from is determined automatically by the internalgetField()name.- Parameters:
- resultSet- the result set to read from
- Returns:
- the read value
- Throws:
- java.sql.SQLException- if reading the value throws an SQLException
- Since:
- 3.0
 
 - 
readValueToRevisionvoid readValueToRevision(java.sql.ResultSet resultSet, InternalCDORevision revision) throws java.sql.SQLExceptionRead 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 internalgetField()name.- Parameters:
- resultSet- the result set to read from
- revision- the revision to which the value should be set.
- Throws:
- java.sql.SQLException- if reading the value throws an SQLException
- Since:
- 3.0
 
 
- 
 
-