Module org.eclipse.persistence.core
Class XMLObjectBuilder
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
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
TreeObjectBuilder,XMLSequencedObjectBuilder
INTERNAL:
Purpose: Object-to-XML specific ObjectBuilder.
- Since:
- TopLink 10i, 03/31/2003 16:29:40
- 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
ConstructorsConstructorDescriptionXMLObjectBuilder(ClassDescriptor descriptor) Create an XML object builder for the descriptor. -
Method Summary
Modifier and TypeMethodDescriptionaddExtraNamespacesToNamespaceResolver(Descriptor desc, AbstractMarshalRecord marshalRecord, CoreAbstractSession session, boolean allowOverride, boolean ignoreEqualResolvers) voidaddNamespaceDeclarations(Document document) voidbuildAttributesIntoObject(Object domainObject, CacheKey cacheKey, AbstractRecord databaseRow, ObjectBuildingQuery query, JoinedAttributeManager joinManager, FetchGroup executionFetchGroup, boolean forRefresh, AbstractSession targetSession) Override method in superclass in order to set the session on the record.buildIntoNestedRow(AbstractRecord row, Object originalObject, Object object, AbstractSession session, Descriptor refDesc, Field xmlField, boolean wasXMLRoot) buildIntoNestedRow(AbstractRecord row, Object object, AbstractSession session) buildIntoNestedRow(AbstractRecord row, Object object, AbstractSession session, Descriptor refDesc, Field xmlField) buildObject(ObjectBuildingQuery query, AbstractRecord databaseRow, JoinedAttributeManager joinManager) INTERNAL: Override the parent's buildObject to allow for the caching of aggregate objects in OX.buildRow(Object object, AbstractSession session, DatabaseField xmlField, XMLRecord parentRecord) Build the nested row into the parent dom.buildRow(AbstractRecord databaseRow, Object object, AbstractSession session) buildRow(AbstractRecord databaseRow, Object object, AbstractSession session, boolean wasXMLRoot) createRecord(int size, AbstractSession session) Create a new row/record for the object builder.createRecord(String rootName, String rootUri, AbstractSession session) Create a new row/record for the object builder with the given name and namespace resolver instead of the namespace resolver from the descriptor.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.createRecordFor(Object attributeValue, Field xmlField, XMLRecord parentRecord, Mapping mapping) createRecordFor(Object object, DocumentPreservationPolicy docPresPolicy) createRecordFor(Object object, DocumentPreservationPolicy docPresPolicy, String rootName, String rootUri) protected AbstractRecordcreateRecordForPKExtraction(int size, AbstractSession session) Create a new row/record for the object builder.extractPrimaryKeyFromExpression(boolean requiresExactMatch, Expression expression, AbstractRecord translationRow, AbstractSession session) Override method in superclass in order to set the session on the record.extractPrimaryKeyFromObject(Object domainObject, AbstractSession session) Extract primary key attribute values from the domainObject.extractPrimaryKeyRowFromExpression(Expression expression, AbstractRecord translationRow, AbstractSession session) Override method in superclass in order to set the session on the record.voidinitialize(AbstractSession session) Cache all the mappings by their attribute and fields.protected booleanIndicates if the object builder's descriptor is an XMLDescriptor.booleanbooleanvoidsetDescriptor(ClassDescriptor aDescriptor) Set the descriptor.voidwriteExtraNamespaces(List extraNamespaces, XMLRecord xmlRecord) voidwriteOutMappings(XMLRecord row, Object object, AbstractSession session) 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, 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, getPrimaryKeyMappings, getReadOnlyMappingsByField, getReadOnlyMappingsForField, getRelationshipMappings, getSequenceMapping, getTargetFieldForQueryKeyName, hasBatchFetchedAttributes, hasCacheIndexesInSopObject, hasInBatchFetchedAttribute, hasJoinedAttributes, hasWrapperPolicy, initialize, 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
-
Constructor Details
-
XMLObjectBuilder
Create an XML object builder for the descriptor.
-
-
Method Details
-
buildRow
public AbstractRecord buildRow(Object object, AbstractSession session, DatabaseField xmlField, XMLRecord parentRecord) Build the nested row into the parent dom. -
createRecord
Create a new row/record for the object builder. This allows subclasses to define different record types.- Overrides:
createRecordin classObjectBuilder
-
createRecord
Create a new row/record for the object builder. This allows subclasses to define different record types.- Overrides:
createRecordin classObjectBuilder
-
createRecord
Create a new row/record for the object builder with the given name. This allows subclasses to define different record types. -
createRecord
Create a new row/record for the object builder with the given name and namespace resolver instead of the namespace resolver from the descriptor. This allows subclasses to define different record types. -
createRecord
Create a new row/record for the object builder with the given name. This allows subclasses to define different record types. -
createRecordFor
public AbstractRecord createRecordFor(Object attributeValue, Field xmlField, XMLRecord parentRecord, Mapping mapping) -
createRecordFor
-
createRecordFor
public AbstractRecord createRecordFor(Object object, DocumentPreservationPolicy docPresPolicy, String rootName, String rootUri) -
createRecordForPKExtraction
Create a new row/record for the object builder. This allows subclasses to define different record types. This will typically be called when a record will be used for temporarily holding on to primary key fields.- Overrides:
createRecordForPKExtractionin classObjectBuilder
-
buildObject
public Object buildObject(ObjectBuildingQuery query, AbstractRecord databaseRow, JoinedAttributeManager joinManager) throws DatabaseException, QueryException INTERNAL: Override the parent's buildObject to allow for the caching of aggregate objects in OX. By caching aggregates along with XML Nodes that they were created from, we are able to preserve the structure and unmapped content of the document that was used to create these objects.- Overrides:
buildObjectin classObjectBuilder- Throws:
DatabaseExceptionQueryException
-
buildRow
-
buildRow
public AbstractRecord buildRow(AbstractRecord databaseRow, Object object, AbstractSession session, boolean wasXMLRoot) -
writeOutMappings
-
addNamespaceDeclarations
-
buildAttributesIntoObject
public void buildAttributesIntoObject(Object domainObject, CacheKey cacheKey, AbstractRecord databaseRow, ObjectBuildingQuery query, JoinedAttributeManager joinManager, FetchGroup executionFetchGroup, boolean forRefresh, AbstractSession targetSession) throws DatabaseException Override method in superclass in order to set the session on the record. Each mapping is recursed to assign values from the Record to the attributes in the domain object.- Overrides:
buildAttributesIntoObjectin classObjectBuilder- Throws:
DatabaseException
-
extractPrimaryKeyRowFromExpression
public AbstractRecord extractPrimaryKeyRowFromExpression(Expression expression, AbstractRecord translationRow, AbstractSession session) Override method in superclass in order to set the session on the record. Return the row with primary keys and their values from the given expression.- Overrides:
extractPrimaryKeyRowFromExpressionin classObjectBuilder
-
extractPrimaryKeyFromExpression
public Object extractPrimaryKeyFromExpression(boolean requiresExactMatch, Expression expression, AbstractRecord translationRow, AbstractSession session) Override method in superclass in order to set the session on the record. Return the row with primary keys and their values from the given expression.- Overrides:
extractPrimaryKeyFromExpressionin classObjectBuilder
-
extractPrimaryKeyFromObject
Description copied from class:ObjectBuilderExtract primary key attribute values from the domainObject.- Overrides:
extractPrimaryKeyFromObjectin classObjectBuilder
-
buildIntoNestedRow
public AbstractRecord buildIntoNestedRow(AbstractRecord row, Object object, AbstractSession session) -
buildIntoNestedRow
public AbstractRecord buildIntoNestedRow(AbstractRecord row, Object object, AbstractSession session, Descriptor refDesc, Field xmlField) -
buildIntoNestedRow
public AbstractRecord buildIntoNestedRow(AbstractRecord row, Object originalObject, Object object, AbstractSession session, Descriptor refDesc, Field xmlField, boolean wasXMLRoot) -
getNamespaceResolver
-
isXmlDescriptor
protected boolean isXmlDescriptor()Indicates if the object builder's descriptor is an XMLDescriptor. The value is lazily initialized. -
setDescriptor
Set the descriptor. This method is overridden so the isXMLDescriptor Boolean can be reset.- Overrides:
setDescriptorin classObjectBuilder
-
addExtraNamespacesToNamespaceResolver
protected List<Namespace> addExtraNamespacesToNamespaceResolver(Descriptor desc, AbstractMarshalRecord marshalRecord, CoreAbstractSession session, boolean allowOverride, boolean ignoreEqualResolvers) -
writeExtraNamespaces
-
initialize
Description copied from class:ObjectBuilderCache all the mappings by their attribute and fields.- Overrides:
initializein classObjectBuilder- Throws:
DescriptorException
-
isXMLObjectBuilder
public boolean isXMLObjectBuilder()- Overrides:
isXMLObjectBuilderin classObjectBuilder
-
isXsiTypeIndicatorField
public boolean isXsiTypeIndicatorField()
-