Module org.eclipse.persistence.core
Class TreeObjectBuilder
java.lang.Object
org.eclipse.persistence.internal.core.descriptors.CoreObjectBuilder<AbstractRecord,AbstractSession,DatabaseField,DatabaseMapping>
org.eclipse.persistence.internal.descriptors.ObjectBuilder
org.eclipse.persistence.internal.oxm.XMLObjectBuilder
org.eclipse.persistence.internal.oxm.TreeObjectBuilder
- All Implemented Interfaces:
Serializable
,Cloneable
,ObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
public class TreeObjectBuilder
extends XMLObjectBuilder
implements ObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
INTERNAL:
Purpose: Perform the unmarshal and marshal operations based on the object-to-XML mapping metadata.
Responsibilities:
- Convert mapping metadata to a tree of XPathNodes. This tree is then traversed during unmarshal and marshal operations.
- Create records appropriate to this implementation of ObjectBuilder.
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.descriptors.ObjectBuilder
batchFetchedAttributes, cloningMappings, descriptor, eagerMappings, fieldsMap, hasCacheIndexesInSopObject, hasInBatchFetchedAttribute, hasWrapperPolicy, isSimple, joinedAttributes, lockAttribute, mappingsByAttribute, mappingsByField, mayHaveNullInPrimaryKey, nonPrimaryKeyMappings, primaryKeyClassifications, primaryKeyExpression, primaryKeyMappings, readOnlyMappingsByField, relationshipMappings, sequenceMapping, shouldKeepRow
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addClassIndicatorFieldToRow
(AbstractMarshalRecord abstractMarshalRecord) addExtraNamespacesToNamespaceResolver
(Descriptor desc, AbstractMarshalRecord marshalRecord, CoreAbstractSession session, boolean allowOverride, boolean ignoreEqualResolvers) buildRow
(XMLRecord record, Object object, CoreAbstractSession session, XMLMarshaller marshaller, XPathFragment rootFragment) buildRow
(AbstractRecord record, Object object, AbstractSession session, DatabaseMapping.WriteType writeType) Build the row representation of an object.Class
<?> classFromRow
(UnmarshalRecord unmarshalRecord, AbstractSession session) createRecord
(int size, AbstractSession session) Create a new row/record for the object builder.createRecord
(String rootName, AbstractSession session) Create a new row/record for the object builder with the given name.createRecord
(String rootName, Node parent, AbstractSession session) Create a new row/record for the object builder with the given name.createRecord
(AbstractSession session) Create a new row/record for the object builder.Return primary key mappings.protected void
initialize
(ClassDescriptor descriptor) void
initialize
(AbstractSession session) Cache all the mappings by their attribute and fields.boolean
marshalAttributes
(MarshalRecord marshalRecord, Object object, CoreAbstractSession session) Methods inherited from class org.eclipse.persistence.internal.oxm.XMLObjectBuilder
addNamespaceDeclarations, buildAttributesIntoObject, buildIntoNestedRow, buildIntoNestedRow, buildIntoNestedRow, buildObject, buildRow, buildRow, buildRow, createRecord, createRecordFor, createRecordFor, createRecordFor, createRecordForPKExtraction, extractPrimaryKeyFromExpression, extractPrimaryKeyFromObject, extractPrimaryKeyRowFromExpression, getNamespaceResolver, isXmlDescriptor, isXMLObjectBuilder, isXsiTypeIndicatorField, setDescriptor, writeExtraNamespaces, writeOutMappings
Methods inherited from class org.eclipse.persistence.internal.descriptors.ObjectBuilder
addPrimaryKeyForNonDefaultTable, addPrimaryKeyForNonDefaultTable, assignReturnRow, assignReturnValueForField, assignReturnValueToMapping, assignSequenceNumber, assignSequenceNumber, assignSequenceNumber, assignSequenceNumber, buildAttributesIntoObjectSOP, buildAttributesIntoShallowObject, buildAttributesIntoWorkingCopyClone, buildAttributesIntoWorkingCopyCloneSOP, buildBackupClone, buildDeleteExpression, buildExpressionFromExample, buildNewInstance, buildObject, buildObject, buildObject, buildObjectFromResultSet, buildObjectInUnitOfWork, buildObjectsFromCursorInto, buildObjectsFromResultSetInto, buildObjectsInto, buildPrimaryKeyAttributesIntoObject, buildPrimaryKeyExpression, buildPrimaryKeyExpressionFromKeys, buildPrimaryKeyExpressionFromObject, buildProtectedObject, buildRow, buildRowForShallowInsert, buildRowForShallowInsert, buildRowForTranslation, buildRowForUpdate, buildRowForUpdate, buildRowForUpdateAfterShallowInsert, buildRowForUpdateAfterShallowInsert, buildRowForUpdateBeforeShallowDelete, buildRowForUpdateBeforeShallowDelete, buildRowForUpdateWithChangeSet, buildRowForWhereClause, buildRowFromPrimaryKeyValues, buildRowWithChangeSet, buildTemplateInsertRow, buildTemplateInsertRow, buildTemplateUpdateRow, buildUpdateExpression, buildWorkingCopyCloneFromRow, buildWorkingCopyCloneNormally, cacheForeignKeyValues, cacheForeignKeyValues, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemove, cascadePerformRemovePrivateOwnedObjectFromChangeSet, cascadeRegisterNewForCreate, clearPrimaryKey, clone, compareForChange, compareObjects, copyInto, copyInto, copyObject, copyQueryInfoToCacheKey, createObjectChangeSet, createObjectChangeSet, createObjectChangeSet, createPrimaryKeyExpression, createRecordFromXMLContext, extractPrimaryKeyFromObject, extractPrimaryKeyFromRow, extractPrimaryKeyRowFromObject, extractRowFromExpression, extractValueFromObjectForField, fixObjectReferences, getBaseChangeRecordForField, getBaseMappingForField, getBaseValueForField, getBatchFetchedAttributes, getCloningMappings, getDescriptor, getEagerMappings, getFieldClassification, getFieldForQueryKeyName, getFieldsMap, getJoinedAttributes, getLockAttribute, getMappingForAttributeName, getMappingForField, getMappingsByAttribute, getMappingsByField, getNonPrimaryKeyMappings, getParentObjectForField, getPrimaryKeyClassifications, getPrimaryKeyExpression, getReadOnlyMappingsByField, getReadOnlyMappingsForField, getRelationshipMappings, getSequenceMapping, getTargetFieldForQueryKeyName, hasBatchFetchedAttributes, hasCacheIndexesInSopObject, hasInBatchFetchedAttribute, hasJoinedAttributes, hasWrapperPolicy, initializeBatchFetchedAttributes, initializeJoinedAttributes, initializePrimaryKey, instantiateClone, instantiateEagerMappings, instantiateWorkingCopyClone, instantiateWorkingCopyCloneFromRow, isPrimaryKeyComponentInvalid, isPrimaryKeyExpression, isPrimaryKeyMapping, isSimple, iterate, load, loadAll, loadAll, loadBatchReadAttributes, loadJoinedAttributes, mergeChangesIntoObject, mergeChangesIntoObject, mergeIntoObject, mergeIntoObject, populateAttributesForClone, postBuildAttributesIntoObjectEvent, postBuildAttributesIntoWorkingCopyCloneEvent, postInitialize, recordPrivateOwnedRemovals, refreshObjectIfRequired, rehashFieldDependancies, setFieldsMap, setHasInBatchFetchedAttribute, setHasWrapperPolicy, setMappingsByAttribute, setMappingsByField, setNonPrimaryKeyMappings, setPrimaryKeyClassifications, setPrimaryKeyExpression, setPrimaryKeyMappings, setReadOnlyMappingsByField, setSequenceMapping, shouldKeepRow, toString, trimFieldsForInsert, unwrapObject, updateCachedAttributes, validate, verifyDelete, wrapObject, writeIntoRowFromPrimaryKeyValues
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.internal.oxm.ObjectBuilder
buildNewInstance, extractPrimaryKeyFromObject, getDescriptor, isXsiTypeIndicatorField
-
Constructor Details
-
TreeObjectBuilder
-
-
Method Details
-
initialize
- Overrides:
initialize
in classObjectBuilder
-
getRootXPathNode
- Specified by:
getRootXPathNode
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
getPrimaryKeyMappings
Description copied from class:ObjectBuilder
Return primary key mappings.- Overrides:
getPrimaryKeyMappings
in classObjectBuilder
-
getTransformationMappings
- Specified by:
getTransformationMappings
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
getContainerValues
- Specified by:
getContainerValues
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
getNullCapableValues
- Specified by:
getNullCapableValues
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
getDefaultEmptyContainerValues
- Specified by:
getDefaultEmptyContainerValues
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
initialize
Description copied from class:ObjectBuilder
Cache all the mappings by their attribute and fields.- Overrides:
initialize
in classXMLObjectBuilder
-
buildRow
public AbstractRecord buildRow(AbstractRecord record, Object object, AbstractSession session, DatabaseMapping.WriteType writeType) Description copied from class:ObjectBuilder
Build the row representation of an object.- Overrides:
buildRow
in classObjectBuilder
-
buildRow
public XMLRecord buildRow(XMLRecord record, Object object, CoreAbstractSession session, XMLMarshaller marshaller, XPathFragment rootFragment) - Specified by:
buildRow
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
marshalAttributes
public boolean marshalAttributes(MarshalRecord marshalRecord, Object object, CoreAbstractSession session) - Specified by:
marshalAttributes
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
createRecord
Create a new row/record for the object builder. This allows subclasses to define different record types.- Specified by:
createRecord
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller> - Overrides:
createRecord
in classXMLObjectBuilder
-
createRecord
Create a new row/record for the object builder with the given name. This allows subclasses to define different record types.- Overrides:
createRecord
in classXMLObjectBuilder
-
createRecord
Create a new row/record for the object builder with the given name. This allows subclasses to define different record types.- Overrides:
createRecord
in classXMLObjectBuilder
-
createRecord
Create a new row/record for the object builder. This allows subclasses to define different record types.- Overrides:
createRecord
in classXMLObjectBuilder
-
addExtraNamespacesToNamespaceResolver
public List addExtraNamespacesToNamespaceResolver(Descriptor desc, AbstractMarshalRecord marshalRecord, CoreAbstractSession session, boolean allowOverride, boolean ignoreEqualResolvers) - Specified by:
addExtraNamespacesToNamespaceResolver
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller> - Overrides:
addExtraNamespacesToNamespaceResolver
in classXMLObjectBuilder
-
addClassIndicatorFieldToRow
- Specified by:
addClassIndicatorFieldToRow
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-
classFromRow
- Specified by:
classFromRow
in interfaceObjectBuilder<AbstractRecord,
AbstractSession, ClassDescriptor, XMLMarshaller>
-