|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
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.ForeignReferenceMapping
org.eclipse.persistence.mappings.ObjectReferenceMapping
org.eclipse.persistence.mappings.VariableOneToOneMapping
public class VariableOneToOneMapping
Purpose: Variable one to one mappings are used to represent a pointer references between a java object and an implementer of an interface. This mapping is usually represented by a single pointer (stored in an instance variable) between the source and target objects. In the relational database tables, these mappings are normally implemented using a foreign key and a typr code.
Field Summary | |
---|---|
protected java.util.Map |
sourceToTargetQueryKeyNames
|
protected DatabaseField |
typeField
|
protected java.util.Map |
typeIndicatorNameTranslation
parallel table typeIndicatorTranslation used prior to initialization to avoid type indicators on Mapping Workbench |
protected java.util.Map |
typeIndicatorTranslation
|
Fields inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping |
---|
foreignKeyFields, isForeignKeyRelationship |
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping |
---|
cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, selectionQuery, tempInitSession, usesBatchReading |
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 | |
---|---|
VariableOneToOneMapping()
PUBLIC: Default constructor. |
Method Summary | |
---|---|
void |
addClassIndicator(java.lang.Class implementer,
java.lang.Object typeIndicator)
PUBLIC: Add a type indicator conversion to this mapping. |
void |
addClassNameIndicator(java.lang.String className,
java.lang.Object typeIndicator)
INTERNAL: Add indicators by classname. |
void |
addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetQueryKeyName)
PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. |
void |
addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName,
java.lang.String sourcePrimaryKeyFieldName)
PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping. |
protected java.lang.Object |
batchedValueFromRow(AbstractRecord row,
ReadAllQuery query)
INTERNAL: Possible for future development, not currently supported. |
protected boolean |
cacheKeysAreEqual(CacheKey cacheKey1,
CacheKey cacheKey2)
INTERNAL: |
java.lang.Object |
clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones. |
protected java.util.Vector |
collectFields()
INTERNAL: Return all the fields populated by this mapping. |
protected boolean |
compareObjectsWithoutPrivateOwned(java.lang.Object firstObject,
java.lang.Object secondObject,
AbstractSession session)
INTERNAL: Compare the references of the two objects are the same, not the objects themselves. |
void |
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings. |
java.util.Vector |
getClassIndicatorAssociations()
INTERNAL: Return the class indicator associations for XML. |
ClassDescriptor |
getDescriptorForTarget(java.lang.Object targetObject,
AbstractSession session)
INTERNAL: Return a descriptor for the target of this mapping For normal ObjectReferenceMappings, we return the reference descriptor. |
java.lang.Class |
getFieldClassification(DatabaseField fieldToClassify)
INTERNAL: Return the classifiction for the field contained in the mapping. |
java.util.Vector |
getForeignKeyFieldNames()
PUBLIC: Return the foreign key field names associated with the mapping. |
protected java.lang.Object |
getImplementorForType(java.lang.Object type,
AbstractSession session)
INTERNAL: Return the implementor for a specified type |
protected java.util.Vector |
getPrimaryKeyForObject(java.lang.Object object,
AbstractSession session)
INTERNAL: |
java.util.Vector |
getSourceToTargetQueryKeyFieldAssociations()
PUBLIC: Return a collection of the field to query key associations. |
java.util.Map |
getSourceToTargetQueryKeyNames()
INTERNAL: Returns the source keys to target keys fields association. |
DatabaseField |
getTypeField()
|
java.lang.String |
getTypeFieldName()
PUBLIC: This method returns the name of the typeField of the mapping. |
protected java.lang.Object |
getTypeForImplementor(java.lang.Class implementor)
INTERNAL: Return the type for a specified implementor |
java.util.Map |
getTypeIndicatorNameTranslation()
INTERNAL: Return the typeIndicatorName translation Used by the Mapping Workbbench to avoid classpath dependancies |
java.util.Map |
getTypeIndicatorTranslation()
INTERNAL: return the type indicator hashtable |
void |
initialize(AbstractSession session)
INTERNAL: Initialize the mapping. |
protected void |
initializeForeignKeys(AbstractSession session)
INTERNAL: The foreign key names and their primary keys are converted to DatabaseField and stored. |
void |
initializeSelectionCriteria(AbstractSession session)
INTERNAL: Selection criteria is created with source foreign keys and target keys. |
boolean |
isRelationalMapping()
INTERNAL: |
boolean |
isVariableOneToOneMapping()
INTERNAL: |
void |
preInitialize(AbstractSession session)
INTERNAL: Set the type field classification through searching the indicators hashtable. |
void |
rehashFieldDependancies(AbstractSession session)
INTERNAL: Rehash any hashtables based on fields. |
void |
setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)
PUBLIC: Set the class indicator associations. |
void |
setForeignKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Return the foreign key field names associated with the mapping. |
void |
setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetQueryKeyName)
PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. |
void |
setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)
PUBLIC: Set a collection of the source to target query key/field associations. |
protected void |
setSourceToTargetQueryKeyFields(java.util.Map sourceToTargetQueryKeyNames)
INTERNAL: Set the source keys to target keys fields association. |
protected void |
setTypeField(DatabaseField typeField)
INTERNAL: This method set the typeField of the mapping to the parameter field |
void |
setTypeFieldName(java.lang.String typeFieldName)
PUBLIC: This method sets the name of the typeField of the mapping. |
protected void |
setTypeIndicatorNameTranslation(java.util.Map translations)
INTERNAL: For avoiding classpath dependancies on the Mapping Workbench |
protected void |
setTypeIndicatorTranslation(java.util.Map translations)
INTERNAL: Set the typeIndicatorTranslations hashtable to the new Hashtable translations |
java.lang.Object |
valueFromObject(java.lang.Object object,
DatabaseField field,
AbstractSession session)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
java.lang.Object |
valueFromRow(AbstractRecord row,
JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
AbstractSession executionSession)
INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object. |
protected void |
writeFromNullObjectIntoRow(AbstractRecord record)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeFromObjectIntoRow(java.lang.Object object,
AbstractRecord record,
AbstractSession session)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
AbstractRecord record,
AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. |
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord,
AbstractRecord record,
AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. |
void |
writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
AbstractRecord record)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord,
AbstractRecord record,
AbstractSession session)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeInsertFieldsIntoRow(AbstractRecord record,
AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected DatabaseField typeField
protected java.util.Map sourceToTargetQueryKeyNames
protected java.util.Map typeIndicatorTranslation
protected java.util.Map typeIndicatorNameTranslation
Constructor Detail |
---|
public VariableOneToOneMapping()
Method Detail |
---|
public boolean isRelationalMapping()
isRelationalMapping
in class DatabaseMapping
public void addClassIndicator(java.lang.Class implementer, java.lang.Object typeIndicator)
public void addClassNameIndicator(java.lang.String className, java.lang.Object typeIndicator)
public void addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetQueryKeyName)
public void addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName, java.lang.String sourcePrimaryKeyFieldName)
protected java.lang.Object batchedValueFromRow(AbstractRecord row, ReadAllQuery query)
batchedValueFromRow
in class ForeignReferenceMapping
public java.lang.Object clone()
clone
in class ForeignReferenceMapping
protected java.util.Vector collectFields()
collectFields
in class ObjectReferenceMapping
protected boolean compareObjectsWithoutPrivateOwned(java.lang.Object firstObject, java.lang.Object secondObject, AbstractSession session)
compareObjectsWithoutPrivateOwned
in class ObjectReferenceMapping
public java.util.Vector getClassIndicatorAssociations()
public ClassDescriptor getDescriptorForTarget(java.lang.Object targetObject, AbstractSession session)
getDescriptorForTarget
in class ObjectReferenceMapping
Bug 2612571
public java.lang.Class getFieldClassification(DatabaseField fieldToClassify)
getFieldClassification
in class DatabaseMapping
public java.util.Vector getForeignKeyFieldNames()
protected java.lang.Object getImplementorForType(java.lang.Object type, AbstractSession session)
public java.util.Vector getSourceToTargetQueryKeyFieldAssociations()
public java.util.Map getSourceToTargetQueryKeyNames()
public DatabaseField getTypeField()
public java.lang.String getTypeFieldName()
protected java.lang.Object getTypeForImplementor(java.lang.Class implementor)
public java.util.Map getTypeIndicatorTranslation()
public java.util.Map getTypeIndicatorNameTranslation()
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
convertClassNamesToClasses
in class ForeignReferenceMapping
public void initialize(AbstractSession session)
initialize
in class ForeignReferenceMapping
protected void initializeForeignKeys(AbstractSession session)
public void initializeSelectionCriteria(AbstractSession session)
public boolean isVariableOneToOneMapping()
isVariableOneToOneMapping
in class DatabaseMapping
protected boolean cacheKeysAreEqual(CacheKey cacheKey1, CacheKey cacheKey2)
cacheKeysAreEqual
in class ObjectReferenceMapping
protected java.util.Vector getPrimaryKeyForObject(java.lang.Object object, AbstractSession session)
getPrimaryKeyForObject
in class ObjectReferenceMapping
public void preInitialize(AbstractSession session) throws DescriptorException
preInitialize
in class ObjectReferenceMapping
DescriptorException
public void rehashFieldDependancies(AbstractSession session)
rehashFieldDependancies
in class DatabaseMapping
public void setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)
public void setForeignKeyFieldNames(java.util.Vector fieldNames)
public void setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetQueryKeyName)
public void setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)
protected void setSourceToTargetQueryKeyFields(java.util.Map sourceToTargetQueryKeyNames)
protected void setTypeField(DatabaseField typeField)
public void setTypeFieldName(java.lang.String typeFieldName)
protected void setTypeIndicatorTranslation(java.util.Map translations)
protected void setTypeIndicatorNameTranslation(java.util.Map translations)
public java.lang.Object valueFromObject(java.lang.Object object, DatabaseField field, AbstractSession session)
valueFromObject
in class DatabaseMapping
public java.lang.Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, AbstractSession executionSession) throws DatabaseException
valueFromRow
in class ForeignReferenceMapping
DatabaseException
protected void writeFromNullObjectIntoRow(AbstractRecord record)
public void writeFromObjectIntoRow(java.lang.Object object, AbstractRecord record, AbstractSession session)
writeFromObjectIntoRow
in class DatabaseMapping
public void writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session)
writeFromObjectIntoRowWithChangeRecord
in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsert(java.lang.Object object, AbstractRecord record, AbstractSession session)
writeFromObjectIntoRowForShallowInsert
in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session)
writeFromObjectIntoRowForShallowInsertWithChangeRecord
in class DatabaseMapping
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord record)
writeFromObjectIntoRowForWhereClause
in class ObjectReferenceMapping
public void writeInsertFieldsIntoRow(AbstractRecord record, AbstractSession session)
writeInsertFieldsIntoRow
in class DatabaseMapping
|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |