EclipseLink 1.0_1.0M2 API Reference - Incubation

org.eclipse.persistence.mappings
Class ObjectTypeMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
          extended by org.eclipse.persistence.mappings.DirectToFieldMapping
              extended by org.eclipse.persistence.mappings.ObjectTypeMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, RelationalMapping

Deprecated. since OracleAS TopLink 10g (10.1.3). This class is replaced by ObjectTypeConverter

public class ObjectTypeMapping
extends DirectToFieldMapping

Purpose: Object type mappings are used to match a fixed number of database primitives to Java objects. They are used when the values on the databae and in the java differ. To create an object type mapping, simply specify the instance variable and field names involved, together with a conversion value. Note this functionality has been somewhat replaced by ObjectTypeConverter which can be used to obtain the same functionality on DirectToField and DirectCollection mappings.

See Also:
ObjectTypeConverter, Serialized Form
Author:
Sati
Since:
Toplink for Java 1.0

Field Summary
 
Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
attributeClassification, attributeClassificationName, attributeObjectClassification, converter, converterClassName, field, isMutable, nullValue
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, primaryKeyMapping, properties, weight, WEIGHT_1
 
Constructor Summary
ObjectTypeMapping()
          Deprecated. PUBLIC: Default constructor.
 
Method Summary
 void addConversionValue(java.lang.Object fieldValue, java.lang.Object attributeValue)
          Deprecated. PUBLIC: A type conversion value is a two-way mapping from the database to the object.
 void addToAttributeOnlyConversionValue(java.lang.Object fieldValue, java.lang.Object attributeValue)
          Deprecated. PUBLIC: An attribute only conversion value is a one-way mapping from the database to the object.
 java.util.Map getAttributeToFieldValues()
          Deprecated. INTERNAL: Get the attribute to field mapping.
 java.lang.Object getAttributeValue(java.lang.Object fieldValue, AbstractSession session)
          Deprecated. INTERNAL: This overides the default behavoir to maintain compatibility with how object-type-mapping handles null values.
 java.lang.Object getDefaultAttributeValue()
          Deprecated. PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped.
 java.util.Vector getFieldToAttributeValueAssociations()
          Deprecated. INTERNAL: Return a collection of the field to attribute value associations.
 java.util.Map getFieldToAttributeValues()
          Deprecated. INTERNAL: Get the field to attribute mapping.
 java.lang.Object getFieldValue(java.lang.Object attributeValue, AbstractSession session)
          Deprecated. INTERNAL: This overides the default behavoir to maintain compatibility with how object-type-mapping handles null values.
 ObjectTypeConverter getObjectTypeConverter()
          Deprecated. PUBLIC: Return the converter cast to ObjectTypeConverter.
 boolean isObjectTypeMapping()
          Deprecated. INTERNAL:
 void mapBooleans()
          Deprecated. PUBLIC: This is a very specific protocol which maps fieldValues "T" and "F" to true and false respectively.
 void mapGenders()
          Deprecated. PUBLIC: This is a very specific protocol which maps fieldValues "F" and "M" to "Female" and "Male" respectively.
 void mapResponses()
          Deprecated. PUBLIC: This is a very specific protocol which maps fieldValues "Y" and "N" to "Yes" and "No" respectively.
 void setAttributeToFieldValues(java.util.Hashtable attributeToFieldValues)
          Deprecated. INTERNAL: Set the attribute to field mapping.
 void setDefaultAttributeValue(java.lang.Object defaultAttributeValue)
          Deprecated. PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped.
 void setFieldToAttributeValueAssociations(java.util.Vector fieldToAttributeValueAssociations)
          Deprecated. INTERNAL: Set a collection of the field to attribute value associations.
 void setFieldToAttributeValues(java.util.Hashtable fieldToAttributeValues)
          Deprecated. INTERNAL: Set the field to attribute mapping.
 
Methods inherited from class org.eclipse.persistence.mappings.DirectToFieldMapping
isRelationalMapping, setFieldName, writeValueIntoRow
 
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
buildBackupClone, buildChangeRecord, buildClone, buildCloneFromRow, buildCloneValue, buildCopy, buildExpression, buildShallowOriginalFromRow, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clone, collectFields, compareForChange, compareObjects, convertClassNamesToClasses, fixObjectReferences, getAttributeClassification, getAttributeClassificationName, getConverter, getField, getFieldClassification, getFieldClassification, getFieldName, getNullValue, getWeight, hasConverter, initialize, internalBuildChangeRecord, isAbstractDirectMapping, isChangeTrackingSupported, isCloningRequired, isDirectToFieldMapping, isMutable, iterate, mergeChangesIntoObject, mergeIntoObject, preInitialize, setAttributeClassification, setAttributeClassificationName, setConverter, setConverterClassName, setField, setFieldClassification, setFieldType, setIsMutable, setNullValue, toString, updateChangeRecord, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromObjectIntoRow, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addToCollectionChangeRecord, buildBackupCloneForPartObject, buildCloneForPartObject, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cloneFields, createUnitOfWorkValueHolder, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDescriptor, getFields, getGetMethodName, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getReferenceDescriptor, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCascadedLockingSupported, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToXMLTypeMapping, isEISMapping, isForeignReferenceMapping, isJoiningSupported, isLazy, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRemotelyInitialized, isSerializedObjectMapping, isStructureMapping, isTransformationMapping, isTypeConversionMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, iterateOnRealAttributeValue, performDataModificationEvent, postDelete, postInitialize, postInsert, postUpdate, preDelete, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, remoteInitialization, remotelyInitialized, removeFromCollectionChangeRecord, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDescriptor, setFields, setGetMethodName, setIsLazy, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectTypeMapping

public ObjectTypeMapping()
Deprecated. 
PUBLIC: Default constructor.

Method Detail

getObjectTypeConverter

public ObjectTypeConverter getObjectTypeConverter()
Deprecated. 
PUBLIC: Return the converter cast to ObjectTypeConverter.


addConversionValue

public void addConversionValue(java.lang.Object fieldValue,
                               java.lang.Object attributeValue)
Deprecated. 
PUBLIC: A type conversion value is a two-way mapping from the database to the object. The database value will be substituted for the object value when read, and the object value will be substituted for database value when written. Note that each field/attribute value must have one and only one attribute/field value to maintain a two-way mapping.


addToAttributeOnlyConversionValue

public void addToAttributeOnlyConversionValue(java.lang.Object fieldValue,
                                              java.lang.Object attributeValue)
Deprecated. 
PUBLIC: An attribute only conversion value is a one-way mapping from the database to the object. This can be used if multiple database values are desired to be mapped to the same object value. Note that when written only the default value will be used for the attribute, not this value.


getAttributeToFieldValues

public java.util.Map getAttributeToFieldValues()
Deprecated. 
INTERNAL: Get the attribute to field mapping.


getDefaultAttributeValue

public java.lang.Object getDefaultAttributeValue()
Deprecated. 
PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped. Any value retreived from the database that is not mapped will be substitued for the default value.


getFieldToAttributeValueAssociations

public java.util.Vector getFieldToAttributeValueAssociations()
Deprecated. 
INTERNAL: Return a collection of the field to attribute value associations.


getFieldToAttributeValues

public java.util.Map getFieldToAttributeValues()
Deprecated. 
INTERNAL: Get the field to attribute mapping.


isObjectTypeMapping

public boolean isObjectTypeMapping()
Deprecated. 
INTERNAL:

Overrides:
isObjectTypeMapping in class DatabaseMapping

mapBooleans

public void mapBooleans()
Deprecated. 
PUBLIC: This is a very specific protocol which maps fieldValues "T" and "F" to true and false respectively.


mapGenders

public void mapGenders()
Deprecated. 
PUBLIC: This is a very specific protocol which maps fieldValues "F" and "M" to "Female" and "Male" respectively.


mapResponses

public void mapResponses()
Deprecated. 
PUBLIC: This is a very specific protocol which maps fieldValues "Y" and "N" to "Yes" and "No" respectively.


setAttributeToFieldValues

public void setAttributeToFieldValues(java.util.Hashtable attributeToFieldValues)
Deprecated. 
INTERNAL: Set the attribute to field mapping.


setDefaultAttributeValue

public void setDefaultAttributeValue(java.lang.Object defaultAttributeValue)
Deprecated. 
PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped. Any value retreived from the database that is not mapped will be substitued for the default value.


setFieldToAttributeValueAssociations

public void setFieldToAttributeValueAssociations(java.util.Vector fieldToAttributeValueAssociations)
Deprecated. 
INTERNAL: Set a collection of the field to attribute value associations.


setFieldToAttributeValues

public void setFieldToAttributeValues(java.util.Hashtable fieldToAttributeValues)
Deprecated. 
INTERNAL: Set the field to attribute mapping.


getFieldValue

public java.lang.Object getFieldValue(java.lang.Object attributeValue,
                                      AbstractSession session)
Deprecated. 
INTERNAL: This overides the default behavoir to maintain compatibility with how object-type-mapping handles null values.

Overrides:
getFieldValue in class AbstractDirectMapping

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.Object fieldValue,
                                          AbstractSession session)
Deprecated. 
INTERNAL: This overides the default behavoir to maintain compatibility with how object-type-mapping handles null values.

Overrides:
getAttributeValue in class AbstractDirectMapping

EclipseLink 1.0_1.0M2 API Reference - Incubation