Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.ProxyManager


        return val;
    }

    public void storeObjectField(int field, Object curVal) {
        // copy mutable fields
        ProxyManager proxy = _sm.getBroker().getConfiguration().
            getProxyManagerInstance();
        FieldMetaData fmd = _sm.getMetaData().getField(field);
        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.ARRAY:
                _field = proxy.copyArray(curVal);
                break;
            case JavaTypes.COLLECTION:
                _field = proxy.copyCollection((Collection) curVal);
                break;
            case JavaTypes.MAP:
                _field = proxy.copyMap((Map) curVal);
                break;
            case JavaTypes.DATE:
                _field = proxy.copyDate((Date) curVal);
                break;
            case JavaTypes.OBJECT:
                _field = proxy.copyCustom(curVal);
                if (_field == null)
                    _field = curVal;
                break;
            default:
                _field = curVal;
View Full Code Here


        if (getTypeCode() != JavaTypes.COLLECTION || isLRS()) {
           _delayCapable = Boolean.FALSE;
           return _delayCapable;
        } else {
            // Verify the proxy manager is configured to handle delay loading
            ProxyManager pm = getRepository().getConfiguration().getProxyManagerInstance();
            if (pm != null) {
                _delayCapable = pm.getDelayCollectionLoading();
            } else {
                _delayCapable = Boolean.FALSE;
            }
        }
        return _delayCapable;
View Full Code Here

        return null;
    }

    public Object newFieldProxy(int field) {
        FieldMetaData fmd = _meta.getField(field);
        ProxyManager mgr = _broker.getConfiguration().
            getProxyManagerInstance();
        Object init = fmd.getInitializer();

        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.DATE:
                return mgr.newDateProxy(fmd.getDeclaredType());
            case JavaTypes.CALENDAR:
                return mgr.newCalendarProxy(fmd.getDeclaredType(),
                    init instanceof TimeZone ? (TimeZone) init : null);
            case JavaTypes.COLLECTION:
                return mgr.newCollectionProxy(fmd.getProxyType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
            case JavaTypes.MAP:
                return mgr.newMapProxy(fmd.getProxyType(),
                    fmd.getKey().getDeclaredType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
        }
View Full Code Here

        return null;
    }

    public Object newFieldProxy(int field) {
        FieldMetaData fmd = _meta.getField(field);
        ProxyManager mgr = _broker.getConfiguration().
            getProxyManagerInstance();
        Object init = fmd.getInitializer();

        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.DATE:
                return mgr.newDateProxy(fmd.getDeclaredType());
            case JavaTypes.CALENDAR:
                return mgr.newCalendarProxy(fmd.getDeclaredType(),
                    init instanceof TimeZone ? (TimeZone) init : null);
            case JavaTypes.COLLECTION:
                return mgr.newCollectionProxy(fmd.getProxyType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
            case JavaTypes.MAP:
                return mgr.newMapProxy(fmd.getProxyType(),
                    fmd.getKey().getDeclaredType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
        }
View Full Code Here

        return val;
    }

    public void storeObjectField(int field, Object curVal) {
        // copy mutable fields
        ProxyManager proxy = _sm.getContext().getConfiguration().
            getProxyManagerInstance();
        FieldMetaData fmd = _sm.getMetaData().getField(field);
        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.ARRAY:
                _field = proxy.copyArray(curVal);
                break;
            case JavaTypes.COLLECTION:
                _field = proxy.copyCollection((Collection) curVal);
                break;
            case JavaTypes.MAP:
                _field = proxy.copyMap((Map) curVal);
                break;
            case JavaTypes.DATE:
                _field = proxy.copyDate((Date) curVal);
                break;
            case JavaTypes.OBJECT:
                _field = proxy.copyCustom(curVal);
                if (_field == null)
                    _field = curVal;
                break;
            default:
                _field = curVal;
View Full Code Here

        return null;
    }

    public Object newFieldProxy(int field) {
        FieldMetaData fmd = _meta.getField(field);
        ProxyManager mgr = _broker.getConfiguration().
            getProxyManagerInstance();
        Object init = fmd.getInitializer();

        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.DATE:
                return mgr.newDateProxy(fmd.getDeclaredType());
            case JavaTypes.CALENDAR:
                return mgr.newCalendarProxy(fmd.getDeclaredType(),
                    init instanceof TimeZone ? (TimeZone) init : null);
            case JavaTypes.COLLECTION:
                return mgr.newCollectionProxy(fmd.getProxyType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null);
            case JavaTypes.MAP:
                return mgr.newMapProxy(fmd.getProxyType(),
                    fmd.getKey().getDeclaredType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null);
        }
        return null;
View Full Code Here

        return null;
    }

    public Object newFieldProxy(int field) {
        FieldMetaData fmd = _meta.getField(field);
        ProxyManager mgr = _broker.getConfiguration().
            getProxyManagerInstance();
        Object init = fmd.getInitializer();

        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.DATE:
                return mgr.newDateProxy(fmd.getDeclaredType());
            case JavaTypes.CALENDAR:
                return mgr.newCalendarProxy(fmd.getDeclaredType(),
                    init instanceof TimeZone ? (TimeZone) init : null);
            case JavaTypes.COLLECTION:
                return mgr.newCollectionProxy(fmd.getProxyType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
            case JavaTypes.MAP:
                return mgr.newMapProxy(fmd.getProxyType(),
                    fmd.getKey().getDeclaredType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
        }
View Full Code Here

        return null;
    }

    public Object newFieldProxy(int field) {
        FieldMetaData fmd = _meta.getField(field);
        ProxyManager mgr = _broker.getConfiguration().
            getProxyManagerInstance();
        Object init = fmd.getInitializer();

        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.DATE:
                return mgr.newDateProxy(fmd.getDeclaredType());
            case JavaTypes.CALENDAR:
                return mgr.newCalendarProxy(fmd.getDeclaredType(),
                    init instanceof TimeZone ? (TimeZone) init : null);
            case JavaTypes.COLLECTION:
                return mgr.newCollectionProxy(fmd.getProxyType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
            case JavaTypes.MAP:
                return mgr.newMapProxy(fmd.getProxyType(),
                    fmd.getKey().getDeclaredType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
        }
View Full Code Here

        return null;
    }

    public Object newFieldProxy(int field) {
        FieldMetaData fmd = _meta.getField(field);
        ProxyManager mgr = _broker.getConfiguration().
            getProxyManagerInstance();
        Object init = fmd.getInitializer();

        switch (fmd.getDeclaredTypeCode()) {
            case JavaTypes.DATE:
                return mgr.newDateProxy(fmd.getDeclaredType());
            case JavaTypes.CALENDAR:
                return mgr.newCalendarProxy(fmd.getDeclaredType(),
                    init instanceof TimeZone ? (TimeZone) init : null);
            case JavaTypes.COLLECTION:
                return mgr.newCollectionProxy(fmd.getProxyType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
            case JavaTypes.MAP:
                return mgr.newMapProxy(fmd.getProxyType(),
                    fmd.getKey().getDeclaredType(),
                    fmd.getElement().getDeclaredType(),
                    init instanceof Comparator ? (Comparator) init : null,
                        _broker.getConfiguration().getCompatibilityInstance().getAutoOff());
        }
View Full Code Here

        if (getTypeCode() != JavaTypes.COLLECTION || isLRS()) {
           _delayCapable = Boolean.FALSE;
           return _delayCapable;
        } else {
            // Verify the proxy manager is configured to handle delay loading
            ProxyManager pm = getRepository().getConfiguration().getProxyManagerInstance();
            if (pm != null) {
                _delayCapable = pm.getDelayCollectionLoading();
            } else {
                _delayCapable = Boolean.FALSE;
            }
        }
        return _delayCapable;
View Full Code Here

TOP

Related Classes of org.apache.openjpa.util.ProxyManager

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.