|
|||||||||
| 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 type code.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
|---|
DatabaseMapping.WriteType |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping |
|---|
INNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER |
| Constructor Summary | |
|---|---|
VariableOneToOneMapping()
PUBLIC: Default constructor. |
|
| Method Summary | |
|---|---|
void |
addClassIndicator(Class implementer,
Object typeIndicator)
PUBLIC: Add a type indicator conversion to this mapping. |
void |
addClassNameIndicator(String className,
Object typeIndicator)
INTERNAL: Add indicators by classname. |
void |
addForeignQueryKeyName(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
String targetQueryKeyName)
PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. |
void |
addForeignQueryKeyName(String sourceForeignKeyFieldName,
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(String targetForeignQueryKeyName,
String sourcePrimaryKeyFieldName)
PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping. |
Object |
clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones. |
void |
convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings. |
Vector |
getClassIndicatorAssociations()
INTERNAL: Return the class indicator associations for XML. |
ClassDescriptor |
getDescriptorForTarget(Object targetObject,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return a descriptor for the target of this mapping For normal ObjectReferenceMappings, we return the reference descriptor. |
Class |
getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classification for the field contained in the mapping. |
Vector |
getForeignKeyFieldNames()
PUBLIC: Return the foreign key field names associated with the mapping. |
Vector |
getSourceToTargetQueryKeyFieldAssociations()
PUBLIC: Return a collection of the field to query key associations. |
Map |
getSourceToTargetQueryKeyNames()
INTERNAL: Returns the source keys to target keys fields association. |
org.eclipse.persistence.internal.helper.DatabaseField |
getTypeField()
|
String |
getTypeFieldName()
PUBLIC: This method returns the name of the typeField of the mapping. |
Map |
getTypeIndicatorNameTranslation()
INTERNAL: Return the typeIndicatorName translation Used by the Mapping Workbench to avoid classpath dependencies |
Map |
getTypeIndicatorTranslation()
INTERNAL: Return the type indicators. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mapping. |
void |
initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Selection criteria is created with source foreign keys and target keys. |
boolean |
isRelationalMapping()
INTERNAL: |
boolean |
isVariableOneToOneMapping()
INTERNAL: |
void |
preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Set the type field classification through searching the indicators hashtable. |
void |
rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Rehash any maps based on fields. |
void |
setClassIndicatorAssociations(Vector classIndicatorAssociations)
PUBLIC: Set the class indicator associations. |
void |
setForeignKeyFieldNames(Vector fieldNames)
PUBLIC: Return the foreign key field names associated with the mapping. |
void |
setForeignQueryKeyName(String sourceForeignKeyFieldName,
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(Vector sourceToTargetQueryKeyFieldAssociations)
PUBLIC: Set a collection of the source to target query key/field associations. |
void |
setTypeField(org.eclipse.persistence.internal.helper.DatabaseField typeField)
INTERNAL: This method set the typeField of the mapping to the parameter field |
void |
setTypeFieldName(String typeFieldName)
PUBLIC: This method sets the name of the typeField of the mapping. |
Object |
valueFromObject(Object object,
org.eclipse.persistence.internal.helper.DatabaseField field,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
Object |
valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object. |
void |
writeFromObjectIntoRow(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
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 |
writeFromObjectIntoRowForShallowInsert(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. |
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. |
void |
writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord record)
INTERNAL: Get a value from the object and set that in the respective field of the row. |
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
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 record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VariableOneToOneMapping()
| Method Detail |
|---|
public boolean isRelationalMapping()
isRelationalMapping in class DatabaseMapping
public void addClassIndicator(Class implementer,
Object typeIndicator)
public void addClassNameIndicator(String className,
Object typeIndicator)
public void addForeignQueryKeyName(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
String targetQueryKeyName)
public void addForeignQueryKeyName(String sourceForeignKeyFieldName,
String targetQueryKeyName)
public void addTargetForeignQueryKeyName(String targetForeignQueryKeyName,
String sourcePrimaryKeyFieldName)
public Object clone()
clone in class ForeignReferenceMappingpublic Vector getClassIndicatorAssociations()
public ClassDescriptor getDescriptorForTarget(Object targetObject,
org.eclipse.persistence.internal.sessions.AbstractSession session)
getDescriptorForTarget in class ObjectReferenceMappingBug 2612571public Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
getFieldClassification in class DatabaseMappingpublic Vector getForeignKeyFieldNames()
public Vector getSourceToTargetQueryKeyFieldAssociations()
public Map getSourceToTargetQueryKeyNames()
public org.eclipse.persistence.internal.helper.DatabaseField getTypeField()
public String getTypeFieldName()
public Map getTypeIndicatorTranslation()
public Map getTypeIndicatorNameTranslation()
public void convertClassNamesToClasses(ClassLoader classLoader)
convertClassNamesToClasses in class ForeignReferenceMappingpublic void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
initialize in class ForeignReferenceMappingpublic void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
public boolean isVariableOneToOneMapping()
isVariableOneToOneMapping in class DatabaseMapping
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
preInitialize in class ObjectReferenceMappingDescriptorExceptionpublic void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
rehashFieldDependancies in class DatabaseMappingpublic void setClassIndicatorAssociations(Vector classIndicatorAssociations)
public void setForeignKeyFieldNames(Vector fieldNames)
public void setForeignQueryKeyName(String sourceForeignKeyFieldName,
String targetQueryKeyName)
public void setSourceToTargetQueryKeyFieldAssociations(Vector sourceToTargetQueryKeyFieldAssociations)
public void setTypeField(org.eclipse.persistence.internal.helper.DatabaseField typeField)
public void setTypeFieldName(String typeFieldName)
public Object valueFromObject(Object object,
org.eclipse.persistence.internal.helper.DatabaseField field,
org.eclipse.persistence.internal.sessions.AbstractSession session)
valueFromObject in class DatabaseMapping
public Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
throws DatabaseException
valueFromRow in class ForeignReferenceMappingDatabaseException
public void writeFromObjectIntoRow(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMapping
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsert(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsert in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsertWithChangeRecord in class DatabaseMapping
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord record)
writeFromObjectIntoRowForWhereClause in class ObjectReferenceMapping
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeInsertFieldsIntoRow in class DatabaseMapping
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||