Package org.eclipse.persistence.indirection

Examples of org.eclipse.persistence.indirection.ValueHolderInterface


        return this.isChangeTracking;
    }

    public Object getAttributeValueFromObject(Object object) {
        if(isValueHolderProperty) {
            ValueHolderInterface vh = (ValueHolderInterface)ormAccessor.getAttributeValueFromObject(object);
            if(vh != null && !vh.isInstantiated()) {
                Object value = vh.getValue();
                oxmAccessor.setAttributeValueInObject(object, value);
                if(vh instanceof WeavedAttributeValueHolderInterface) {
                    ((WeavedAttributeValueHolderInterface)vh).setIsCoordinatedWithProperty(true);
                }
            }
View Full Code Here


            if(listener != null) {
                listener.propertyChange(new PropertyChangeEvent(object, oxmAccessor.getAttributeName(), value, oldValue));
            }
        }
        if(isValueHolderProperty) {
            ValueHolderInterface vh = (ValueHolderInterface)ormAccessor.getAttributeValueFromObject(object);
            if(vh == null) {
                vh = new ValueHolder();
                ((ValueHolder)vh).setIsNewlyWeavedValueHolder(true);
            }
            vh.setValue(value);
            ormAccessor.setAttributeValueInObject(object, vh);
        }
        oxmAccessor.setAttributeValueInObject(object, value);
    }
View Full Code Here

     * INTERNAL:
     * Return the value to be stored in the object's attribute.
     * This will be a proxy object.
     */
    public Object valueFromRow(Object object) {
        ValueHolderInterface valueHolder = new ValueHolder(object);

        return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder);
    }
View Full Code Here

                descriptor = (ClassDescriptor)descriptor.getInterfacePolicy().getChildDescriptors().firstElement();
            }
        } catch (Exception e) {
            return null;
        }
        ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session);

        return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder);
    }
View Full Code Here

     * Return the value to be stored in the object's attribute.
     * This value is determined by invoking the appropriate method on the object and passing it the
     * row and session.
     */
    public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) {
        ValueHolderInterface valueHolder = new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session);

        return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder);
    }
View Full Code Here

        } catch (Exception e) {
            //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***");
            e.printStackTrace();
            return null;
        }
        ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery);

        return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder);
    }
View Full Code Here

     * Return whether the specified object is instantiated.
     */
    public boolean objectIsInstantiated(Object object) {
        if (object instanceof Proxy) {
            ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(object);
            ValueHolderInterface valueHolder = handler.getValueHolder();
            return valueHolder.isInstantiated();
        } else {
            return true;
        }
    }
View Full Code Here

     * instantiate the value.
     */
    public Object getRealAttributeValueFromObject(Object obj, Object object) {
        if (object instanceof Proxy) {
            ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(object);
            ValueHolderInterface valueHolder = handler.getValueHolder();
            return valueHolder.getValue();
        } else {
            return object;
        }
    }
View Full Code Here

     * INTERNAL:
     * Return the original indirection object for a unit of work indirection object.
     */
    public Object getOriginalIndirectionObject(Object unitOfWorkIndirectionObject, AbstractSession session) {
        if (unitOfWorkIndirectionObject instanceof UnitOfWorkValueHolder) {
            ValueHolderInterface valueHolder = ((UnitOfWorkValueHolder)unitOfWorkIndirectionObject).getWrappedValueHolder();
            if ((valueHolder == null) && session.isRemoteUnitOfWork()) {
                RemoteSessionController controller = ((RemoteUnitOfWork)session).getParentSessionController();
                valueHolder = (ValueHolderInterface)controller.getRemoteValueHolders().get(((UnitOfWorkValueHolder)unitOfWorkIndirectionObject).getWrappedValueHolderRemoteID());
            }
            return valueHolder;
View Full Code Here

        if ((referenceObject == null) || !Proxy.isProxyClass(referenceObject.getClass())) {
            return null;
        }

        ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(referenceObject);
        ValueHolderInterface valueHolder = handler.getValueHolder();

        if (valueHolder.isInstantiated()) {
            return null;
        } else {
            return ((DatabaseValueHolder)valueHolder).getRow();
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.indirection.ValueHolderInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.