Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.ObjectId


            case ClassMetaData.ID_APPLICATION:
                if (ImplHelper.isAssignable(meta.getObjectIdType(),
                    val.getClass())) {
                    if (!meta.isOpenJPAIdentity()
                        && meta.isObjectIdTypeShared())
                        return new ObjectId(cls, val);
                    return val;
                }

                // stringified app id?
                if (val instanceof String
View Full Code Here


                    return new StateManagerId((String) oid);
                return new Id(cls, ((Number) oid).longValue());
            case ClassMetaData.ID_APPLICATION:
                if (ImplHelper.isAssignable(meta.getObjectIdType(), oid.getClass())) {
                    if (!meta.isOpenJPAIdentity() && meta.isObjectIdTypeShared())
                        return new ObjectId(cls, oid);
                    return oid;
                }

                if (meta.getIdClass() == null) {
                    expected = pks[0].getDeclaredType();
View Full Code Here

            case ClassMetaData.ID_APPLICATION:
                if (ImplHelper.isAssignable(meta.getObjectIdType(),
                    val.getClass())) {
                    if (!meta.isOpenJPAIdentity()
                        && meta.isObjectIdTypeShared())
                        return new ObjectId(cls, val);
                    return val;
                }

                // stringified app id?
                if (val instanceof String
View Full Code Here

            case ClassMetaData.ID_APPLICATION:
                if (ImplHelper.isAssignable(meta.getObjectIdType(),
                    val.getClass())) {
                    if (!meta.isOpenJPAIdentity()
                        && meta.isObjectIdTypeShared())
                        return new ObjectId(cls, val);
                    return val;
                }

                // stringified app id?
                if (val instanceof String
View Full Code Here

            return new LongId(cls, (Long) oid);
        if (oid instanceof Short)
            return new ShortId(cls, (Short) oid);
        if (oid instanceof String)
            return new StringId(cls, (String) oid);
        return new ObjectId(cls, oid);
    }
View Full Code Here

            case ClassMetaData.ID_APPLICATION:
                if (ImplHelper.isAssignable(meta.getObjectIdType(),
                    val.getClass())) {
                    if (!meta.isOpenJPAIdentity()
                        && meta.isObjectIdTypeShared())
                        return new ObjectId(cls, val);
                    return val;
                }

                // stringified app id?
                if (val instanceof String
View Full Code Here

            createEmployee3(em, eId3++);
        tran.begin();
        em.flush();
        tran.commit();
        for (Dependent3 d: deps3) {
            ObjectId did = (ObjectId)((StateManagerImpl)((PersistenceCapable)d)
                  .pcGetStateManager()).getObjectId();
          dids3.add(did.getId());
          depMap3.put(did.getId(), d);
        }
       
        em.close();
    }
View Full Code Here

        Object actual = oid.getClass();

        // embedded id and derived id
        if (pks.length > 0 && (pks[0].isEmbedded() || pks[0].isTypePC())) {
            if (pks[0].getDeclaredType().equals(oid.getClass())) {
                return new ObjectId(cls, oid);
            }
            expected = pks[0].getDeclaredType();
        }
        if (oidType != null && oidType.equals(oid.getClass())) {
            // Check for compound id class
            return new ObjectId(cls, oid);
        }
        if (meta.getIdentityType() == ClassMetaData.ID_DATASTORE) {
            // no id field
            try {
                return new Id(cls, ((Number) oid).longValue());
View Full Code Here

            case ClassMetaData.ID_APPLICATION:
                if (ImplHelper.isAssignable(meta.getObjectIdType(),
                    val.getClass())) {
                    if (!meta.isOpenJPAIdentity()
                        && meta.isObjectIdTypeShared())
                        return new ObjectId(cls, val);
                    return val;
                }

                // stringified app id?
                if (val instanceof String
View Full Code Here

        Object actual = oid.getClass();

        // embedded id and derived id
        if (pks.length > 0 && (pks[0].isEmbedded() || pks[0].isTypePC())) {
            if (pks[0].getDeclaredType().equals(oid.getClass())) {
                return new ObjectId(cls, oid);
            }
            expected = pks[0].getDeclaredType();
        }
        if (oidType != null && oidType.equals(oid.getClass())) {
            // Check for compound id class
            return new ObjectId(cls, oid);
        }
        if (meta.getIdentityType() == ClassMetaData.ID_DATASTORE) {
            // no id field
            try {
                return new Id(cls, ((Number) oid).longValue());
View Full Code Here

TOP

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

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.