/** * @see org.seasar.framework.jpa.metadata.AttributeDesc#getValue(java.lang.Object) */ public Object getValue(Object entity) { return mapping.getRealAttributeValueFromObject(entity, null); }
DatabaseMapping mapping = descriptor.getMappingForAttributeName((String)joinManager.getJoinedAttributes().get(index)); if (mapping !=null){ Object attributeValue = mapping.getRealAttributeValueFromObject(clone, unitOfWork); if (attributeValue != null){ if ( mapping.isForeignReferenceMapping() && (((ForeignReferenceMapping)mapping).getIndirectionPolicy().usesTransparentIndirection()) ) {
/** * This is used for a remote unit of work. * If the value holder is sent back to the server uninstantiated and * it needs to be instantiated, then we must find the original * object and get the appropriate attribute from it. */ protected Object getValueFromServerObject() { setSession(getRemoteUnitOfWork()); Vector primaryKey = getSession().keyFromObject(getSourceObject()); Object originalObject = getUnitOfWork().getParent().getIdentityMapAccessor().getFromIdentityMap(primaryKey, getSourceObject().getClass()); if (originalObject == null) { originalObject = getUnitOfWork().getParent().readObject(getSourceObject()); } ClassDescriptor descriptor = getSession().getDescriptor(originalObject); DatabaseMapping mapping = descriptor.getObjectBuilder().getMappingForAttributeName(getSourceAttributeName()); setMapping(mapping); return getMapping().getRealAttributeValueFromObject(originalObject, getSession()); }
/** * INTERNAL: * Create an instance of the composite primary key class for the key object. */ public Object createPrimaryKeyInstance(Object key, AbstractSession session) { Object keyInstance = getPKClassInstance(); ObjectBuilder builder = getDescriptor().getObjectBuilder(); KeyElementAccessor[] pkElementArray = this.getKeyClassFields(getPKClass()); for (int index = 0; index < pkElementArray.length; index++) { KeyElementAccessor accessor = pkElementArray[index]; DatabaseMapping mapping = builder.getMappingForAttributeName(accessor.getAttributeName()); // With session validation, the mapping shouldn't be null at this // point, don't bother checking. while (mapping.isAggregateObjectMapping()) { mapping = mapping.getReferenceDescriptor().getObjectBuilder().getMappingForAttributeName(pkElementArray[index].getAttributeName()); if (mapping == null) { // must be aggregate mapping = builder.getMappingForField(accessor.getDatabaseField()); } } Object fieldValue = mapping.getRealAttributeValueFromObject(key, (oracle.toplink.essentials.internal.sessions.AbstractSession) session); accessor.setValue(keyInstance, fieldValue); } return keyInstance; }
Object aggregate = mapping.getRealAttributeValueFromObject(toWriteInto, session); if (aggregate == null) { aggregate = mapping.getReferenceDescriptor().getJavaClass().newInstance();
Object valueToIterate = mapping.getRealAttributeValueFromObject(object, session); UnitOfWorkImpl uow = isObjectUnregistered ? (UnitOfWorkImpl)session : null; aggregateValue = mapping.getRealAttributeValueFromObject(aggregateValue, session);
getMapping().getContainerPolicy().removeFrom(unwrappedValue, getMapping().getRealAttributeValueFromObject(oldParent, getSession()), getSession());
mapping = descriptor.getObjectBuilder().getMappingForAttributeName(getField().getName()); if (mapping != null) { value = mapping.getRealAttributeValueFromObject(value, session); } else { DatabaseField queryKeyField = descriptor.getObjectBuilder().getFieldForQueryKeyName(getField().getName());