/** * INTERNAL: * Return whether the specified object can be instantiated without database access. */ public boolean objectIsEasilyInstantiated(Object object) { ValueHolderInterface valueHolder = ((IndirectContainer)object).getValueHolder(); if (valueHolder instanceof DatabaseValueHolder) { return ((DatabaseValueHolder)valueHolder).isEasilyInstantiated(); } else { return true; } }
/** * INTERNAL: * set the source object into QueryBasedValueHolder. */ public void setSourceObject(Object sourceObject, Object attributeValue) { if( attributeValue instanceof IndirectContainer) { ValueHolderInterface valueHolder = ((IndirectContainer)attributeValue).getValueHolder(); if (valueHolder instanceof QueryBasedValueHolder) { ((QueryBasedValueHolder)valueHolder).setSourceObject(sourceObject); } } }
/** * INTERNAL: * Return whether the specified object is instantiated. */ public boolean objectIsInstantiated(Object object) { return ((IndirectContainer)object).getValueHolder().isInstantiated(); }
/** * INTERNAL: * Return the "real" attribute value, as opposed to any wrapper. * This will trigger the wrapper to instantiate the value. */ public Object getRealAttributeValueFromObject(Object object, Object attribute) { return ((IndirectContainer)attribute).getValueHolder().getValue(); }
/** * INTERNAL: * Iterate over the specified attribute value, */ public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { super.iterateOnAttributeValue(iterator, ((IndirectContainer)attributeValue).getValueHolder()); }
/** * INTERNAL: * Return whether the specified object is instantiated. */ public boolean objectIsInstantiated(Object object) { return ((IndirectContainer)object).getValueHolder().isInstantiated(); }
/** * INTERNAL: * Return the "real" attribute value, as opposed to any wrapper. * This will trigger the wrapper to instantiate the value. */ public Object getRealAttributeValueFromObject(Object object, Object attribute) { return ((IndirectContainer)attribute).getValueHolder().getValue(); }
/** * INTERNAL: * Iterate over the specified attribute value, */ public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { super.iterateOnAttributeValue(iterator, ((IndirectContainer)attributeValue).getValueHolder()); }
/** * INTERNAL: * Return the "real" attribute value, as opposed to any wrapper. * This will trigger the wrapper to instantiate the value. */ public Object getRealAttributeValueFromObject(Object object, Object attribute) { return ((IndirectContainer)attribute).getValueHolder().getValue(); }
/** * INTERNAL: * Return whether the specified object is instantiated. */ public boolean objectIsInstantiated(Object object) { return ((IndirectContainer)object).getValueHolder().isInstantiated(); }
/** * INTERNAL: * set the source object into QueryBasedValueHolder. */ public void setSourceObject(Object sourceObject, Object attributeValue) { if( attributeValue instanceof IndirectContainer) { ValueHolderInterface valueHolder = ((IndirectContainer)attributeValue).getValueHolder(); if (valueHolder instanceof QueryBasedValueHolder) { ((QueryBasedValueHolder)valueHolder).setSourceObject(sourceObject); } } }
/** * INTERNAL: * Return a backup clone of the attribute. */ public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) { IndirectContainer container = (IndirectContainer)attributeValue; ValueHolderInterface valueHolder = container.getValueHolder(); ValueHolderInterface newValueHolder = (ValueHolderInterface)super.backupCloneAttribute(valueHolder, clone, backup, unitOfWork); return buildContainer(newValueHolder); }
/** * INTERNAL: * Return a backup clone of the attribute. */ public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) { IndirectContainer container = (IndirectContainer)attributeValue; ValueHolderInterface valueHolder = container.getValueHolder(); ValueHolderInterface newValueHolder = (ValueHolderInterface)super.backupCloneAttribute(valueHolder, clone, backup, unitOfWork); return buildContainer(newValueHolder); }
/** * INTERNAL: * Return a backup clone of the attribute. */ public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) { IndirectContainer container = (IndirectContainer)attributeValue; ValueHolderInterface valueHolder = container.getValueHolder(); ValueHolderInterface newValueHolder = (ValueHolderInterface)super.backupCloneAttribute(valueHolder, clone, backup, unitOfWork); return buildContainer(newValueHolder); }
/** * INTERNAL: * Return a clone of the attribute. * @param buildDirectlyFromRow indicates that we are building the clone directly * from a row as opposed to building the original from the row, putting it in * the shared cache, and then cloning the original. */ public Object cloneAttribute(Object attributeValue, Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession, boolean buildDirectlyFromRow) { IndirectContainer container = (IndirectContainer)attributeValue; ValueHolderInterface valueHolder = container.getValueHolder(); ValueHolderInterface newValueHolder = (ValueHolderInterface)super.cloneAttribute(valueHolder, original, cacheKey, clone, refreshCascade, cloningSession, buildDirectlyFromRow); return buildContainer(newValueHolder); }
/** * INTERNAL: * Return the original indirection object for a unit of work indirection object. */ public Object getOriginalIndirectionObjectForMerge(Object unitOfWorkIndirectionObject, AbstractSession session) { IndirectContainer container = (IndirectContainer) getOriginalIndirectionObject(unitOfWorkIndirectionObject, session); DatabaseValueHolder holder = (DatabaseValueHolder)container.getValueHolder(); if (holder != null && holder.getSession()!= null){ holder.setSession(session); } return container; }
/** * INTERNAL * Replace the client value holder with the server value holder, * after copying some of the settings from the client value holder. */ public void mergeRemoteValueHolder(Object clientSideDomainObject, Object serverSideDomainObject, MergeManager mergeManager) { // This will always be a transparent with a remote. IndirectContainer serverContainer = (IndirectContainer)getMapping().getAttributeValueFromObject(serverSideDomainObject); RemoteValueHolder serverValueHolder = (RemoteValueHolder)serverContainer.getValueHolder(); mergeClientIntoServerValueHolder(serverValueHolder, mergeManager); getMapping().setAttributeValueInObject(clientSideDomainObject, serverContainer); }
/** * INTERNAL: * Set the value of the appropriate attribute of target to attributeValue. * In this case, place the value inside the target's ValueHolder. */ public void setRealAttributeValueInObject(Object target, Object attributeValue) { IndirectContainer container = (IndirectContainer)this.getMapping().getAttributeValueFromObject(target); container.getValueHolder().setValue(attributeValue); this.getMapping().setAttributeValueInObject(target, container); }
/** * INTERNAL: * Set the value of the appropriate attribute of target to attributeValue. * In this case, place the value inside the target's ValueHolder. */ public void setRealAttributeValueInObject(Object target, Object attributeValue) { IndirectContainer container = (IndirectContainer)this.getMapping().getAttributeValueFromObject(target); container.getValueHolder().setValue(attributeValue); this.getMapping().setAttributeValueInObject(target, container); }
/** * INTERNAL: * Set the value of the appropriate attribute of target to attributeValue. * In this case, place the value inside the target's ValueHolder. */ public void setRealAttributeValueInObject(Object target, Object attributeValue) { IndirectContainer container = (IndirectContainer)this.getMapping().getAttributeValueFromObject(target); container.getValueHolder().setValue(attributeValue); this.getMapping().setAttributeValueInObject(target, container); }