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:
- Serialized Form
-
-
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
Constructors Constructor Description TreeObjectBuilder(ClassDescriptor descriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddClassIndicatorFieldToRow(AbstractMarshalRecord abstractMarshalRecord)ListaddExtraNamespacesToNamespaceResolver(Descriptor desc, AbstractMarshalRecord marshalRecord, CoreAbstractSession session, boolean allowOverride, boolean ignoreEqualResolvers)XMLRecordbuildRow(XMLRecord record, Object object, CoreAbstractSession session, XMLMarshaller marshaller, XPathFragment rootFragment)AbstractRecordbuildRow(AbstractRecord record, Object object, AbstractSession session, DatabaseMapping.WriteType writeType)Build the row representation of an object.Class<?>classFromRow(UnmarshalRecord unmarshalRecord, AbstractSession session)AbstractRecordcreateRecord(int size, AbstractSession session)Create a new row/record for the object builder.AbstractMarshalRecordcreateRecord(String rootName, AbstractSession session)Create a new row/record for the object builder with the given name.AbstractMarshalRecordcreateRecord(String rootName, Node parent, AbstractSession session)Create a new row/record for the object builder with the given name.AbstractRecordcreateRecord(AbstractSession session)Create a new row/record for the object builder.ListgetContainerValues()ListgetDefaultEmptyContainerValues()ListgetNullCapableValues()List<DatabaseMapping>getPrimaryKeyMappings()Return primary key mappings.XPathNodegetRootXPathNode()ListgetTransformationMappings()protected voidinitialize(ClassDescriptor descriptor)voidinitialize(AbstractSession session)Cache all the mappings by their attribute and fields.booleanmarshalAttributes(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 Detail
-
TreeObjectBuilder
public TreeObjectBuilder(ClassDescriptor descriptor)
-
-
Method Detail
-
initialize
protected void initialize(ClassDescriptor descriptor)
- Overrides:
initializein classObjectBuilder
-
getRootXPathNode
public XPathNode getRootXPathNode()
- Specified by:
getRootXPathNodein interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
getPrimaryKeyMappings
public List<DatabaseMapping> getPrimaryKeyMappings()
Description copied from class:ObjectBuilderReturn primary key mappings.- Overrides:
getPrimaryKeyMappingsin classObjectBuilder
-
getTransformationMappings
public List getTransformationMappings()
- Specified by:
getTransformationMappingsin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
getContainerValues
public List getContainerValues()
- Specified by:
getContainerValuesin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
getNullCapableValues
public List getNullCapableValues()
- Specified by:
getNullCapableValuesin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
getDefaultEmptyContainerValues
public List getDefaultEmptyContainerValues()
- Specified by:
getDefaultEmptyContainerValuesin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
initialize
public void initialize(AbstractSession session)
Description copied from class:ObjectBuilderCache all the mappings by their attribute and fields.- Overrides:
initializein classXMLObjectBuilder
-
buildRow
public AbstractRecord buildRow(AbstractRecord record, Object object, AbstractSession session, DatabaseMapping.WriteType writeType)
Description copied from class:ObjectBuilderBuild the row representation of an object.- Overrides:
buildRowin classObjectBuilder
-
buildRow
public XMLRecord buildRow(XMLRecord record, Object object, CoreAbstractSession session, XMLMarshaller marshaller, XPathFragment rootFragment)
- Specified by:
buildRowin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
marshalAttributes
public boolean marshalAttributes(MarshalRecord marshalRecord, Object object, CoreAbstractSession session)
- Specified by:
marshalAttributesin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
createRecord
public AbstractRecord createRecord(AbstractSession session)
Create a new row/record for the object builder. This allows subclasses to define different record types.- Specified by:
createRecordin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>- Overrides:
createRecordin classXMLObjectBuilder
-
createRecord
public AbstractMarshalRecord createRecord(String rootName, AbstractSession session)
Create a new row/record for the object builder with the given name. This allows subclasses to define different record types.- Overrides:
createRecordin classXMLObjectBuilder
-
createRecord
public AbstractMarshalRecord createRecord(String rootName, Node parent, AbstractSession session)
Create a new row/record for the object builder with the given name. This allows subclasses to define different record types.- Overrides:
createRecordin classXMLObjectBuilder
-
createRecord
public AbstractRecord createRecord(int size, AbstractSession session)
Create a new row/record for the object builder. This allows subclasses to define different record types.- Overrides:
createRecordin classXMLObjectBuilder
-
addExtraNamespacesToNamespaceResolver
public List addExtraNamespacesToNamespaceResolver(Descriptor desc, AbstractMarshalRecord marshalRecord, CoreAbstractSession session, boolean allowOverride, boolean ignoreEqualResolvers)
- Specified by:
addExtraNamespacesToNamespaceResolverin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>- Overrides:
addExtraNamespacesToNamespaceResolverin classXMLObjectBuilder
-
addClassIndicatorFieldToRow
public boolean addClassIndicatorFieldToRow(AbstractMarshalRecord abstractMarshalRecord)
- Specified by:
addClassIndicatorFieldToRowin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
classFromRow
public Class<?> classFromRow(UnmarshalRecord unmarshalRecord, AbstractSession session)
- Specified by:
classFromRowin interfaceObjectBuilder<AbstractRecord,AbstractSession,ClassDescriptor,XMLMarshaller>
-
-