|
EclipseLink 2.4.0, build 'v20111118-r10419' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
public abstract class AbstractDirectMapping
Purpose: Maps an attribute or some other property to the corresponding database field type. The list of field types that are supported by EclipseLink's direct to field mapping is dependent on the relational database being used.
AbstractAttributeDirectMapping,
org.eclipse.persistence.mappings.foundation.MultitenantPrimaryKeyMapping,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
|---|
DatabaseMapping.WriteType |
| Field Summary | |
|---|---|
protected org.eclipse.persistence.internal.helper.DatabaseField |
field
DatabaseField which this mapping represents. |
| Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
|---|
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM |
| Constructor Summary | |
|---|---|
AbstractDirectMapping()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object clone,
org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone. |
Expression |
buildExpression(java.lang.Object queryObject,
QueryByExamplePolicy policy,
Expression expressionBuilder,
java.util.Map processedObjects,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value for a directToField mapping. |
void |
buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object original,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Builds a shallow original object. |
void |
cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL: Cascade perform delete through mappings that require the cascade. |
void |
cascadeRegisterNewIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade. |
java.lang.Object |
clone()
INTERNAL: The mapping clones itself to create deep copy. |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
collectFields()
Returns the field this mapping represents. |
void |
fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
RemoteSession session)
INTERNAL: An object has been serialized from the server to the client. |
java.lang.String |
getAttributeClassificationName()
Deprecated. |
java.lang.Object |
getAttributeValue(java.lang.Object fieldValue,
Session session)
Deprecated. |
Converter |
getConverter()
PUBLIC: Return the converter on the mapping. |
org.eclipse.persistence.internal.helper.DatabaseField |
getField()
INTERNAL: Returns the field which this mapping represents. |
java.lang.Class |
getFieldClassification()
ADVANCED: Return the class type of the field value. |
java.lang.String |
getFieldName()
PUBLIC: Name of the field this mapping represents. |
abstract java.lang.Object |
getFieldValue(java.lang.Object objectValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Convert the object (attribute or property) value to a field value. |
java.lang.Object |
getNullValue()
PUBLIC: Allow for the value used for null to be specified. |
abstract java.lang.Object |
getObjectValue(java.lang.Object fieldValue,
Session session)
INTERNAL Allows for subclasses to convert the the attribute or property value. |
ClassDescriptor |
getReferenceDescriptor()
INTERNAL: Get the descriptor for this mapping This method is potentially called when this mapping is used as a map key and will return null since direct mappings do not have reference descriptors. |
java.lang.Integer |
getWeight()
INTERNAL: Return the weight of the mapping, used to sort mappings to ensure that DirectToField Mappings get merged first |
boolean |
hasConverter()
Indicates if the mapping has a converter set on it. |
boolean |
isAbstractDirectMapping()
INTERNAL: |
boolean |
isCloningRequired()
INTERNAL: Return if this mapping requires its attribute value to be cloned. |
boolean |
isInsertable()
PUBLIC: By default mappings are insertable. |
boolean |
isMutable()
PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced. |
boolean |
isUpdatable()
PUBLIC: By default mappings are updatable. |
void |
iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
INTERNAL: Iterate on the appropriate attribute. |
abstract void |
setAttributeClassification(java.lang.Class attributeClassification)
Deprecated. |
void |
setAttributeClassificationName(java.lang.String attributeClassificationName)
Deprecated. |
void |
setConverter(Converter converter)
PUBLIC: Set the converter on the mapping. |
void |
setField(org.eclipse.persistence.internal.helper.DatabaseField theField)
ADVANCED: Set the field in the mapping. |
void |
setFieldClassification(java.lang.Class fieldType)
ADVANCED: Set the class type of the field value. |
void |
setFieldType(int jdbcType)
ADVANCED: Set the JDBC type of the field value. |
void |
setIsMutable(boolean isMutable)
PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced. |
void |
setNullValue(java.lang.Object nullValue)
PUBLIC: Allow for the value used for null to be specified. |
java.lang.String |
toString()
INTERNAL: |
void |
validateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow for subclasses to perform validation. |
void |
writeFromObjectIntoRow(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeFromObjectIntoRowForUpdate(WriteObjectQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
INTERNAL: Write the attribute value from the object to the row for update. |
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values. |
void |
writeUpdateFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for update into the template for with null values. |
protected abstract void |
writeValueIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.helper.DatabaseField field,
java.lang.Object value)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected org.eclipse.persistence.internal.helper.DatabaseField field
| Constructor Detail |
|---|
public AbstractDirectMapping()
| Method Detail |
|---|
public boolean isMutable()
public boolean isInsertable()
public boolean isUpdatable()
public void setIsMutable(boolean isMutable)
public void setNullValue(java.lang.Object nullValue)
public Expression buildExpression(java.lang.Object queryObject,
QueryByExamplePolicy policy,
Expression expressionBuilder,
java.util.Map processedObjects,
org.eclipse.persistence.internal.sessions.AbstractSession session)
buildExpression in class DatabaseMapping
public void cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
cascadePerformRemoveIfRequired in class DatabaseMapping
public void cascadeRegisterNewIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
cascadeRegisterNewIfRequired in class DatabaseMappingpublic java.lang.Object clone()
clone in class DatabaseMappingprotected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> collectFields()
collectFields in class DatabaseMapping
public void fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
RemoteSession session)
fixObjectReferences in class DatabaseMappingpublic Converter getConverter()
public org.eclipse.persistence.internal.helper.DatabaseField getField()
getField in class DatabaseMappingpublic boolean isAbstractDirectMapping()
isAbstractDirectMapping in class DatabaseMappingpublic ClassDescriptor getReferenceDescriptor()
getReferenceDescriptor in class DatabaseMappingpublic java.lang.Class getFieldClassification()
public void setFieldClassification(java.lang.Class fieldType)
public void setFieldType(int jdbcType)
public java.lang.String getFieldName()
public abstract java.lang.Object getFieldValue(java.lang.Object objectValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
@Deprecated public java.lang.String getAttributeClassificationName()
org.eclipse.persistence.mappings.foundation.AbstractAttributeDirectMapping.getAttributeClassificationName()
@Deprecated
public java.lang.Object getAttributeValue(java.lang.Object fieldValue,
Session session)
getObjectValue(Object, Session),
which implements getAttributeValue()public java.lang.Object getNullValue()
public abstract java.lang.Object getObjectValue(java.lang.Object fieldValue,
Session session)
public java.lang.Integer getWeight()
getWeight in class DatabaseMappingpublic boolean hasConverter()
public void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
iterate in class DatabaseMapping@Deprecated public abstract void setAttributeClassification(java.lang.Class attributeClassification)
org.eclipse.persistence.mappings.foundation.AbstractAttributeDirectMapping.setAttributeClassification(Class)@Deprecated public void setAttributeClassificationName(java.lang.String attributeClassificationName)
org.eclipse.persistence.mappings.foundation.AbstractAttributeDirectMapping.setAttributeClassificationName(String)public void setConverter(Converter converter)
public void setField(org.eclipse.persistence.internal.helper.DatabaseField theField)
public java.lang.String toString()
toString in class DatabaseMappingpublic boolean isCloningRequired()
isCloningRequired in class DatabaseMapping
public void validateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
validateBeforeInitialization in class DatabaseMappingDescriptorException
public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object clone,
org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
buildCloneFromRow in class DatabaseMapping
public void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object original,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
buildShallowOriginalFromRow in class DatabaseMapping
protected abstract void writeValueIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.helper.DatabaseField field,
java.lang.Object value)
public void writeFromObjectIntoRow(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMapping
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
writeFromObjectIntoRowForUpdate in class DatabaseMapping
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeInsertFieldsIntoRow in class DatabaseMapping
public void writeUpdateFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeUpdateFieldsIntoRow in class DatabaseMapping
|
EclipseLink 2.4.0, build 'v20111118-r10419' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||