Purpose: A transformation mapping is used for a specialized translation between how a value is represented in Java and its representation on the databae. Transformation mappings should only be used when other mappings are inadequate.
| Modifier and Type | Field and Description |
|---|---|
| protected AttributeTransformer | attributeTransformer
attributeTransformerClassName is converter to an instance of AttributeTransformer |
| protected String | attributeTransformerClassName
Name of the class which implements AttributeTransformer to be used to retrieve the attribute value |
| protected List | fieldToTransformers
The TransformerClassNames are converted into instances of FieldTransformer |
| protected List | fieldTransformations
Stores field name and the class name of a FieldTransformer in a vector to preserve order |
| protected IndirectionPolicy | indirectionPolicy
Implements indirection behaviour |
| protected boolean | isMutable
PERF: Indicates if this mapping's attribute is a simple value which cannot be modified only replaced. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFieldTransformation(DatabaseField field, String methodName)
PUBLIC: Add the field and the name of the method that returns the value to be placed in said field when the object is written to the database. |
| public void | addFieldTransformation(String fieldName, String methodName)
PUBLIC: Add the name of field and the name of the method that returns the value to be placed in said field when the object is written to the database. |
| public void | addFieldTransformer(String fieldName, FieldTransformer transformer)
PUBLIC: Add the name of field and the transformer that returns the value to be placed in the field when the object is written to the database. |
| public void | addFieldTransformer(DatabaseField field, FieldTransformer transformer)
PUBLIC: Add the field and the transformer that returns the value to be placed in the field when the object is written to the database. |
| public void | addFieldTransformerClassName(String fieldName, String className)
INTERNAL: Add the name of a field and the name of a class which implements the FieldTransformer interface. |
| public void | addFieldTransformerClassName(DatabaseField field, String className)
INTERNAL: Add the name of a field and the name of a class which implements the FieldTransformer interface. |
| protected boolean | areObjectsToBeProcessedInstantiated(Object object)
INTERNAL: The referenced object is checked if it is instantiated or not |
| public void | buildBackupClone(Object
TODO clone, Object TODO backup, UnitOfWorkImpl TODO unitOfWork)Implements abstract org. |
| public Object | buildBackupCloneForPartObject(Object
TODO attributeValue, Object TODO clone, Object TODO backup, UnitOfWorkImpl TODO unitOfWork)Overrides org. |
| public ChangeRecord | buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session)
Overrides org. |
| public void | buildClone(Object
TODO original, CacheKey TODO cacheKey, Object TODO clone, Integer TODO refreshCascade, AbstractSession TODO cloningSession)Implements abstract org. |
| public Object | buildCloneForPartObject(Object
TODO attributeValue, Object TODO original, CacheKey TODO cacheKey, Object TODO clone, AbstractSession TODO cloningSession, Integer TODO refreshCascade, boolean TODO isExisting, boolean TODO isFromSharedCache)Overrides org. |
| public void | buildCloneFromRow(AbstractRecord
TODO record, JoinedAttributeManager TODO joinManager, Object TODO clone, CacheKey TODO sharedCacheKey, ObjectBuildingQuery TODO sourceQuery, UnitOfWorkImpl TODO unitOfWork, AbstractSession TODO executionSession)Implements abstract org. |
| public void | buildCopy(Object
TODO copy, Object TODO original, CopyGroup TODO group)Overrides org. |
| protected AbstractRecord | buildPhantomRowFrom(Object domainObject, AbstractSession session)
INTERNAL Build a phantom row that contains only the fields for the mapping, populated with the values generated by invoking the field methods on the specified object. |
| public void | buildShallowOriginalFromRow(AbstractRecord
TODO record, Object later the input to buildCloneFromRow original, JoinedAttributeManager TODO joinManager, ObjectBuildingQuery TODO query, AbstractSession TODO executionSession)Overrides org. |
| public void | cascadePerformRemoveIfRequired(Object
TODO object, UnitOfWorkImpl TODO uow, Map<K, V> TODO visitedObjects)Implements abstract org. |
| public void | cascadeRegisterNewIfRequired(Object
TODO object, UnitOfWorkImpl TODO uow, Map<K, V> TODO visitedObjects)Implements abstract org. |
| public Object | clone()
Overrides org. |
| protected Vector | collectFields()
Overrides org. |
| public ChangeRecord | compareForChange(Object
TODO clone, Object TODO backUp, ObjectChangeSet TODO owner, AbstractSession TODO session)Implements abstract org. |
| public boolean | compareObjects(Object
TODO firstObject, Object TODO secondObject, AbstractSession TODO session)Implements abstract org. |
| public void | convertClassNamesToClasses(ClassLoader
TODO classLoader)Overrides org. |
| public <T> DatabaseValueHolder | createCloneValueHolder(ValueHolderInterface<T>
TODO attributeValue, Object TODO original, Object TODO clone, AbstractRecord TODO row, AbstractSession TODO cloningSession, boolean indicates that we are building the clone directly
from a row as opposed to building the original from the row, putting it in
the shared cache, and then cloning the original. buildDirectlyFromRow)Overrides org. |
| public void | dontUseIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. |
| public void | fixObjectReferences(Object
TODO object, Map<Object, ObjectDescriptor> TODO objectDescriptors, Map<Object, Object> TODO processedObjects, ObjectLevelReadQuery TODO query, DistributedSession TODO session)Implements abstract org. |
| public String | |
| public AttributeTransformer | getAttributeTransformer()
INTERNAL: The attributeTransformer stores an instance of the class which implements AttributeTransformer. |
| public Class | |
| public String | |
| public Object | getAttributeValueFromObject(Object
TODO object)Overrides org. |
| public Vector | |
| public Hashtable | Returns: a hash table containing the fieldName and their respective method namesINTERNAL: Required for reverse compatibility and test cases: |
| public List | Returns: a vector which stores fields and their respective transformers.INTERNAL: |
| public List | getFieldTransformations()
INTERNAL: Returns a Vector which stores fieldnames and the respective method/transformer names. |
| public IndirectionPolicy | |
| public Object | getRealAttributeValueFromAttribute(Object attributeValue, Object object, AbstractSession session)
Overrides org. |
| public Object | getValueFromRemoteValueHolder(RemoteValueHolder<T> remoteValueHolder)
Overrides org. |
| public void | initialize(AbstractSession session)
Overrides org. |
| protected void | initializeAttributeTransformer(AbstractSession databaseSession)
INTERNAL: Convert the attribute transformer class name into an AttributeTransformer If the old-style method name in set, then use a MethodBasedAttributeTRansformer |
| protected void | initializeFieldToTransformers(AbstractSession session)
INTERNAL: Convert the field names and their corresponding method names to DatabaseFields and Methods. |
| public void | instantiateAttribute(Object object, AbstractSession session)
Overrides org. |
| public ChangeRecord | internalBuildChangeRecord(Object clone, Object oldValue, ObjectChangeSet owner, AbstractSession session)
INTERNAL: Build a change record. |
| public Object | invokeAttributeTransformer(AbstractRecord record, Object domainObject, AbstractSession session)
INTERNAL: Invoke the buildAttributeValue method on the AttributeTransformer |
| protected Object | invokeFieldTransformer(DatabaseField field, FieldTransformer transformer, Object domainObject, AbstractSession session)
INTERNAL: Invoke the buildFieldValue on the appropriate FieldTransformer |
| protected Object | |
| public boolean | isAttributeValueFromObjectInstantiated(Object object)
Overrides org. |
| public boolean | isChangeTrackingSupported(Project project)
Overrides org. |
| public boolean | isMutable()
PUBLIC: Return true if the attribute for this mapping is not a simple atomic value that cannot be modified, only replaced. |
| public boolean | isReadOnly()
Overrides org. |
| public boolean | |
| public boolean | isWriteOnly()
Overrides org. |
| public void | iterate(DescriptorIterator iterator)
Implements abstract org. |
| public void | iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue)
Overrides org. |
| public void | mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)
Implements abstract org. |
| public void | mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)
Implements abstract org. |
| public void | preInitialize(AbstractSession session)
Overrides org. |
| public Object | readFromReturnRowIntoObject(AbstractRecord row, Object object, ReadObjectQuery query, Collection<E> handledMappings, ObjectChangeSet changeSet)
INTERNAL: Extracts value from return row and set the attribute to the value in the object. |
| public Object | readFromRowIntoObject(AbstractRecord row, JoinedAttributeManager joinManager, Object object, CacheKey parentCacheKey, ObjectBuildingQuery query, AbstractSession executionSession, boolean isTargetProtected)
Overrides org. |
| public void | remoteInitialization(DistributedSession session)
Overrides org. |
| public void | |
| public void | setAttributeTransformer(AttributeTransformer transformer)
PUBLIC: Set the AttributeTransformer, this transformer will be used to extract the value for the object's attribute from the database row. |
| public void | setAttributeTransformerClass(Class<?> attributeTransformerClass)
INTERNAL: Set the attribute transformer's class. |
| public void | setAttributeTransformerClassName(String className)
INTERNAL: Set the Attribute Transformer Class Name |
| public void | setAttributeValueInObject(Object
TODO object, Object TODO value)Overrides org. |
| public void | setFieldNameToMethodNameAssociations(Vector<E> associations)
INTERNAL: needed for backwards compatibility |
| protected void | |
| public void | setFieldTransformations(List<FieldTransformation> fieldTransformations)
INTERNAL: Set the field to method name associations. |
| public void | |
| public void | setIsMutable(boolean mutable)
PUBLIC: Set if the value of the attribute is atomic or a complex mutable object and can be modified without replacing the entire object. |
| public void | setRealAttributeValueInObject(Object object, Object value)
Overrides org. |
| public void | |
| public void | updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow)
Overrides org. |
| public void | useBasicIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. |
| public void | useContainerIndirection(Class<?> containerClass)
PUBLIC: Indirection means that a IndirectContainer (wrapping a ValueHolder) will be put in-between the attribute and the real object. |
| public void | useIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. |
| public boolean | usesIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. |
| public void | validateBeforeInitialization(AbstractSession session)
Overrides org. |
| public Object | valueFromObject(Object
TODO object, DatabaseField TODO field, AbstractSession TODO session)Overrides org. |
| public void | writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.
Overrides org. |
| public void | writeFromObjectIntoRowForUpdate(WriteObjectQuery query, AbstractRecord record)
Overrides org. |
| public void | writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session, DatabaseMapping.
Overrides org. |
| public void | writeInsertFieldsIntoRow(AbstractRecord record, AbstractSession session)
Overrides org. |