final TreeObjectBuilder objectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder();
TreeObjectBuilder objectBuilder = (TreeObjectBuilder) descriptor.getObjectBuilder(); final XPathNodeWrapper nodeWrapper = actualNodeWrapper;
/** * INTERNAL: * Creates the Array of simple types used to recreate this map. */ public Object createSerializableMapKeyInfo(Object key, AbstractSession session){ return referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(key, session); }
/** * INTERNAL: * Used to build the object, and register it if in the context of a unit of work. */ @Override public Object buildObject(AbstractRecord row) { return this.descriptor.getObjectBuilder().buildObject(this, row, this.joinedAttributeManager); }
/** * INTERNAL: * Returns the mapping that will be used to access the version value from an object. */ public AbstractDirectMapping getVersionMapping(){ if (this.lockMapping != null){ return this.lockMapping; }else{ return (AbstractDirectMapping)this.descriptor.getObjectBuilder().getBaseMappingForField(this.writeLockField); } }
/** * INTERNAL: * Creates the Array of simple types used to recreate this map. */ public Object createSerializableMapKeyInfo(Object key, AbstractSession session){ return referenceDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(key, session); }
/** * INTERNAL: * This method is used to revert an object within the unit of work * @param cloneMapping may not be the same as what is in the uow */ public void revertChanges(Object clone, ClassDescriptor descriptor, UnitOfWorkImpl uow, Map cloneMapping, boolean forRefresh) { cloneMapping.put(clone, buildBackupClone(clone, descriptor.getObjectBuilder(), uow)); clearChanges(clone, uow, descriptor, forRefresh); }
/** * INTERNAL: * Cascade discover and persist new objects during commit to the map key */ @Override public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, boolean getAttributeValueFromObject, Set cascadeErrors){ ObjectBuilder builder = getReferenceDescriptor(object.getClass(), uow).getObjectBuilder(); builder.cascadeDiscoverAndPersistUnregisteredNewObjects(object, newObjects, unregisteredExistingObjects, visitedObjects, uow, cascadeErrors); }
/** * INTERNAL: * This method is used to revert an object within the unit of work * @param cloneMapping may not be the same as what is in the uow */ public void revertChanges(Object clone, ClassDescriptor descriptor, UnitOfWorkImpl uow, Map cloneMapping, boolean forRefresh) { cloneMapping.put(clone, buildBackupClone(clone, descriptor.getObjectBuilder(), uow)); clearChanges(clone, uow, descriptor, forRefresh); }
@Override protected Object buildCompositeObject(ClassDescriptor descriptor, AbstractRecord nestedRow, ObjectBuildingQuery query, CacheKey parentsCacheKey, JoinedAttributeManager joinManager, AbstractSession targetSession) { if (((EISDescriptor)descriptor).isXMLFormat()) { return descriptor.getObjectBuilder().buildObject(query, nestedRow, joinManager); } else { Object element = descriptor.getObjectBuilder().buildNewInstance(); descriptor.getObjectBuilder().buildAttributesIntoObject(element, parentsCacheKey, nestedRow, query, joinManager, query.getExecutionFetchGroup(descriptor), false, targetSession); return element; } }
/** * INTERNAL: * Overridden by mappings that require additional processing of the change record after the record has been calculated. */ @Override public void recordPrivateOwnedRemovals(Object object, UnitOfWorkImpl uow) { Object target = getRealAttributeValueFromObject(object, uow); if (target != null){ this.referenceDescriptor.getObjectBuilder().recordPrivateOwnedRemovals(target, uow, false); } }
/** * INTERNAL: */ protected Object getPrimaryKeyForObject(Object object, AbstractSession session) { return getReferenceDescriptor().getObjectBuilder().extractPrimaryKeyFromObject(object, session); }
/** * INTERNAL: * Cascade discover and persist new objects during commit. */ public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) { Object objectReferenced = getRealAttributeValueFromObject(object, uow); if (objectReferenced != null) { ObjectBuilder builder = getReferenceDescriptor(objectReferenced.getClass(), uow).getObjectBuilder(); builder.cascadeRegisterNewForCreate(objectReferenced, uow, visitedObjects); } }
/** * INTERNAL: * Extract the reference pk for rvh usage in remote model. */ public AbstractRecord extractPrimaryKeyRowForSourceObject(Object domainObject, AbstractSession session) { AbstractRecord databaseRow = getDescriptor().getObjectBuilder().createRecord(session); writeFromObjectIntoRow(domainObject, databaseRow, session, WriteType.UNDEFINED); return databaseRow; }
/** * INTERNAL: * Values to be included in the locking mechanism are added * to the translation row. Set the translation row to all the original field values. */ @Override public void addLockValuesToTranslationRow(ObjectLevelModifyQuery query) { verifyUsage(query.getSession()); query.setTranslationRow(descriptor.getObjectBuilder().buildRowForWhereClause(query)); }
/** * INTERNAL: * Return the relationshipPartner mapping for this bi-directional mapping. If the relationshipPartner is null then * this is a uni-directional mapping. */ @Override public DatabaseMapping getRelationshipPartner() { if ((this.relationshipPartner == null) && (this.relationshipPartnerAttributeName != null)) { setRelationshipPartner(getReferenceDescriptor().getObjectBuilder().getMappingForAttributeName(getRelationshipPartnerAttributeName())); } return this.relationshipPartner; }
public void iterate(Object object) { if (!containsObjectInIdentityMap(IdentityMapAccessor.this.session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, IdentityMapAccessor.this.getSession()), object.getClass())) { IdentityMapAccessor.this.session.log(SessionLog.FINEST, SessionLog.CACHE, "stack_of_visited_objects_that_refer_to_the_corrupt_object", getVisitedStack()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object_referenced_through_mapping", getCurrentMapping()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object", object); } } };
public DatabaseMapping getMappingFromQueryKey() { QueryKey queryKey = getQueryKeyOrNull(); if ((queryKey == null) || (!(queryKey instanceof DirectQueryKey))) { throw QueryException.cannotConformExpression(); } mapping = queryKey.getDescriptor().getObjectBuilder().getMappingForField(((DirectQueryKey)queryKey).getField()); if (mapping == null) { throw QueryException.cannotConformExpression(); } return mapping; }
protected AbstractRecord buildCompositeRowForDescriptor(ClassDescriptor classDesc, Object attributeValue, AbstractSession session, XMLRecord parentRow, WriteType writeType) { XMLObjectBuilder objectBuilder = (XMLObjectBuilder) classDesc.getObjectBuilder(); XMLRecord child = (XMLRecord) objectBuilder.createRecordFor(attributeValue, (XMLField) getField(), parentRow, this); child.setNamespaceResolver(parentRow.getNamespaceResolver()); child.setSession(session); objectBuilder.buildIntoNestedRow(child, attributeValue, session, (XMLDescriptor)getReferenceDescriptor(), (XMLField) getField()); return child; }
@Override protected Object buildCompositeRow(Object attributeValue, AbstractSession session, AbstractRecord record, WriteType writeType) { if (((EISDescriptor)getDescriptor()).isXMLFormat()) { XMLObjectBuilder objectBuilder = (XMLObjectBuilder)getReferenceDescriptor(attributeValue, session).getObjectBuilder(); return objectBuilder.buildRow(attributeValue, session, getField(), (XMLRecord)record); } else { AbstractRecord nestedRow = this.getObjectBuilder(attributeValue, session).buildRow(attributeValue, session, writeType); return this.getReferenceDescriptor(attributeValue, session).buildFieldValueFromNestedRow(nestedRow, session); } }