Module org.eclipse.persistence.core
Class WeavedObjectBasicIndirectionPolicy
java.lang.Object
org.eclipse.persistence.internal.indirection.IndirectionPolicy
org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy
org.eclipse.persistence.internal.indirection.WeavedObjectBasicIndirectionPolicy
- All Implemented Interfaces:
Serializable
,Cloneable
A WeavedObjectBasicIndirectionPolicy is used by OneToOne mappings that are LAZY through weaving
and which use Property(method) access.
It extends BasicIndirection by providing the capability of calling the set method that was initially
mapped in addition to the set method for the weaved valueholder in order to coordinate the value of the
underlying property with the value stored in the valueholder
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Stores the actual type of the mapping if different from the reference type.protected String
Name of the initial get method.protected boolean
indicates whether the mapping has originally used method accessprotected Method
Lazily initialized set method based on the set method name.protected String
Name of the initial set method.Fields inherited from class org.eclipse.persistence.internal.indirection.IndirectionPolicy
mapping
-
Constructor Summary
ConstructorDescriptionWeavedObjectBasicIndirectionPolicy
(String getMethodName, String setMethodName, String actualTypeClassName, boolean hasUsedMethodAccess) -
Method Summary
Modifier and TypeMethodDescriptiongetRealAttributeValueFromObject
(Object object, Object attribute) Return the "real" attribute value, as opposed to any wrapper.protected Method
This method will lazily initialize the set method Lazy initialization occurs to that we are not required to have a handle on the actual class that we are using until runtime.boolean
boolean
INTERNAL:void
setRealAttributeValueInObject
(Object target, Object attributeValue) Set the value of the appropriate attribute of target to attributeValue.void
setRealAttributeValueInObject
(Object target, Object attributeValue, boolean trackChanges) Set the value of the appropriate attribute of target to attributeValue.void
updateValueInObject
(Object object, Object value, Object attributeValue) Coordinate the valueholder for this mapping with the underlying property by calling the initial setter method.Methods inherited from class org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy
backupCloneAttribute, buildIndirectObject, cloneAttribute, extractPrimaryKeyForReferenceObject, extractReferenceRow, fixObjectReferences, getOriginalIndirectionObject, getOriginalIndirectionObjectForMerge, getOriginalValueHolder, getValueFromRemoteValueHolder, isAttributeValueFullyBuilt, iterateOnAttributeValue, mergeRemoteValueHolder, nullValueFromRow, objectIsEasilyInstantiated, objectIsInstantiated, reset, setSourceObject, typeIsValid, validateAttributeOfInstantiatedObject, validateDeclaredAttributeType, validateGetMethodReturnType, validateSetMethodParameterType, valueFromBatchQuery, valueFromMethod, valueFromQuery, valueFromQuery, valueFromRow
Methods inherited from class org.eclipse.persistence.internal.indirection.IndirectionPolicy
buildCascadeQuery, clone, getCollectionMapping, getForeignReferenceMapping, getMapping, getOneToOneMapping, getTransformationMapping, initialize, instantiateObject, mergeClientIntoServerValueHolder, objectIsInstantiatedOrChanged, setMapping, setUseLazyInstantiation, shouldUseLazyInstantiation, usesIndirection, usesTransparentIndirection, validateContainerPolicy, validateDeclaredAttributeTypeForCollection, validateGetMethodReturnTypeForCollection, validateSetMethodParameterTypeForCollection
-
Field Details
-
setMethodName
Name of the initial set method. -
setMethod
Lazily initialized set method based on the set method name. -
getMethodName
Name of the initial get method. -
hasUsedMethodAccess
protected boolean hasUsedMethodAccessindicates whether the mapping has originally used method access -
actualTypeClassName
Stores the actual type of the mapping if different from the reference type. Used for set method invocation
-
-
Constructor Details
-
WeavedObjectBasicIndirectionPolicy
-
-
Method Details
-
getActualTypeClassName
-
getRealAttributeValueFromObject
Return the "real" attribute value, as opposed to any wrapper. This will trigger the wrapper to instantiate the value. In a weaved policy, this will also call the initial setter method to coordinate the values of the valueholder with the underlying data.- Overrides:
getRealAttributeValueFromObject
in classBasicIndirectionPolicy
-
getSetMethod
This method will lazily initialize the set method Lazy initialization occurs to that we are not required to have a handle on the actual class that we are using until runtime. This helps to satisfy the weaving requirement that demands that we avoid loading domain classes into the main class loader until after weaving occurs. -
updateValueInObject
Coordinate the valueholder for this mapping with the underlying property by calling the initial setter method. -
setRealAttributeValueInObject
Set the value of the appropriate attribute of target to attributeValue. In this case, place the value inside the target's ValueHolder. Change tracking will be turned off when this method is called- Overrides:
setRealAttributeValueInObject
in classBasicIndirectionPolicy
-
setRealAttributeValueInObject
public void setRealAttributeValueInObject(Object target, Object attributeValue, boolean trackChanges) Set the value of the appropriate attribute of target to attributeValue. In this case, place the value inside the target's ValueHolder. if trackChanges is true, set the value in the object as if the user was setting it. Allow change tracking to pick up the change.- Overrides:
setRealAttributeValueInObject
in classIndirectionPolicy
-
getGetMethodName
-
getSetMethodName
-
hasUsedMethodAccess
public boolean hasUsedMethodAccess() -
isWeavedObjectBasicIndirectionPolicy
public boolean isWeavedObjectBasicIndirectionPolicy()Description copied from class:IndirectionPolicy
INTERNAL:- Overrides:
isWeavedObjectBasicIndirectionPolicy
in classIndirectionPolicy
-