Top Description Fields Constructors Methods
org.eclipse.persistence.internal.indirection

public Class WeavedObjectBasicIndirectionPolicy

extends BasicIndirectionPolicy
Class Inheritance
Imports
java.beans.PropertyChangeListener, java.lang.reflect.InvocationTargetException, .Method, org.eclipse.persistence.descriptors.changetracking.ChangeTracker, org.eclipse.persistence.exceptions.DescriptorException, org.eclipse.persistence.indirection.ValueHolderInterface, .WeavedAttributeValueHolderInterface, org.eclipse.persistence.internal.helper.Helper, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.mappings.ForeignReferenceMapping

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
Author
Tom Ware

Field Summary

Modifier and TypeField and Description
protected String
actualTypeClassName

Stores the actual type of the mapping if different from the reference type.

protected String
getMethodName

Name of the initial get method.

protected boolean
hasUsedMethodAccess

indicates whether the mapping has originally used method access

protected transient Method
setMethod

Lazily initialized set method based on the set method name.

protected String
setMethodName

Name of the initial set method.

Constructor Summary

AccessConstructor and Description
public
WeavedObjectBasicIndirectionPolicy(String getMethodName, String setMethodName, String actualTypeClassName, boolean hasUsedMethodAccess)

Method Summary

Modifier and TypeMethod and Description
public String
public String
public Object
getRealAttributeValueFromObject(Object object, Object attribute)

Overrides org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy.getRealAttributeValueFromObject.

Return the "real" attribute value, as opposed to any wrapper.
protected Method
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.

public String
public boolean
public boolean
public void
setRealAttributeValueInObject(Object target, Object attributeValue)

Overrides org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy.setRealAttributeValueInObject.

Set the value of the appropriate attribute of target to attributeValue.
public void
setRealAttributeValueInObject(Object target, Object attributeValue, boolean trackChanges)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.setRealAttributeValueInObject.

Set the value of the appropriate attribute of target to attributeValue.
public void
updateValueInObject(Object object, Object value, Object attributeValue)

Coordinate the valueholder for this mapping with the underlying property by calling the initial setter method.

Inherited from org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy:
backupCloneAttributebuildIndirectObjectcloneAttributeextractPrimaryKeyForReferenceObjectextractReferenceRowfixObjectReferencesgetOriginalIndirectionObjectgetOriginalIndirectionObjectForMergegetOriginalValueHoldergetValueFromRemoteValueHolderisAttributeValueFullyBuiltiterateOnAttributeValuemergeRemoteValueHoldernullValueFromRowobjectIsEasilyInstantiatedobjectIsInstantiatedresetsetSourceObjecttypeIsValidvalidateAttributeOfInstantiatedObjectvalidateDeclaredAttributeTypevalidateGetMethodReturnTypevalidateSetMethodParameterTypevalueFromBatchQueryvalueFromMethodvalueFromQueryvalueFromQueryvalueFromRow

Field Detail

actualTypeClassNameback to summary
protected String actualTypeClassName

Stores the actual type of the mapping if different from the reference type. Used for set method invocation

getMethodNameback to summary
protected String getMethodName

Name of the initial get method.

hasUsedMethodAccessback to summary
protected boolean hasUsedMethodAccess

indicates whether the mapping has originally used method access

setMethodback to summary
protected transient Method setMethod

Lazily initialized set method based on the set method name.

setMethodNameback to summary
protected String setMethodName

Name of the initial set method.

Constructor Detail

WeavedObjectBasicIndirectionPolicyback to summary
public WeavedObjectBasicIndirectionPolicy(String getMethodName, String setMethodName, String actualTypeClassName, boolean hasUsedMethodAccess)

Method Detail

getActualTypeClassNameback to summary
public String getActualTypeClassName()
getGetMethodNameback to summary
public String getGetMethodName()
getRealAttributeValueFromObjectback to summary
public Object getRealAttributeValueFromObject(Object object, Object attribute)

Overrides org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy.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.

Annotations
@Override
getSetMethodback to summary
protected Method 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.

getSetMethodNameback to summary
public String getSetMethodName()
hasUsedMethodAccessback to summary
public boolean hasUsedMethodAccess()
isWeavedObjectBasicIndirectionPolicyback to summary
public boolean isWeavedObjectBasicIndirectionPolicy()

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.isWeavedObjectBasicIndirectionPolicy.

Doc from org.eclipse.persistence.internal.indirection.IndirectionPolicy.isWeavedObjectBasicIndirectionPolicy.

INTERNAL:

Annotations
@Override
setRealAttributeValueInObjectback to summary
public void setRealAttributeValueInObject(Object target, Object attributeValue)

Overrides org.eclipse.persistence.internal.indirection.BasicIndirectionPolicy.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

Annotations
@Override
setRealAttributeValueInObjectback to summary
public void setRealAttributeValueInObject(Object target, Object attributeValue, boolean trackChanges)

Overrides org.eclipse.persistence.internal.indirection.IndirectionPolicy.setRealAttributeValueInObject.

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.

Annotations
@Override
updateValueInObjectback to summary
public void updateValueInObject(Object object, Object value, Object attributeValue)

Coordinate the valueholder for this mapping with the underlying property by calling the initial setter method.