Examples of OID


Examples of org.apache.isis.core.metamodel.adapter.oid.Oid

    }

    private Set<Oid> rendered = Sets.newHashSet();
    @Override
    public boolean canEagerlyRender(ObjectAdapter objectAdapter) {
        final Oid oid = objectAdapter.getOid();
        return rendered.add(oid);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.Oid

    }

    private Set<Oid> rendered = Sets.newHashSet();
    @Override
    public boolean canEagerlyRender(ObjectAdapter objectAdapter) {
        final Oid oid = objectAdapter.getOid();
        return rendered.add(oid);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.Oid

        persistedObjects = new ObjectStorePersistedObjectsDefault();
    }

    @Test
    public void noServicesInitially() throws Exception {
        final Oid service = persistedObjects.getService(ObjectSpecId.of("fooService"));
        assertThat(service, is(nullValue()));
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.Oid

    @Test
    public void registerServicesMakesAvailable() throws Exception {
        persistedObjects.registerService(ObjectSpecId.of("fooService"), mockOidForFooService);

        final Oid service = persistedObjects.getService(ObjectSpecId.of("fooService"));
        assertThat(service, is(mockOidForFooService));
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.Oid

    @Test
    public void registerServicesWhenMoreThanOnePullsOutTheCorrectOne() throws Exception {
        persistedObjects.registerService(ObjectSpecId.of("fooService"), mockOidForFooService);
        persistedObjects.registerService(ObjectSpecId.of("barService"), mockOidForBarService);

        final Oid service = persistedObjects.getService(ObjectSpecId.of("fooService"));
        assertThat(service, is(mockOidForFooService));
    }
View Full Code Here

Examples of org.datanucleus.identity.OID

        {
            // Generate the "oid" for this object (of type pcClassForObject), and find the object for that
            StatementMappingIndex datastoreIdMapping =
                stmtMapping.getMappingForMemberPosition(StatementClassMapping.MEMBER_DATASTORE_ID);
            JavaTypeMapping mapping = datastoreIdMapping.getMapping();
            OID oid = (OID)mapping.getObject(ec, rs, datastoreIdMapping.getColumnPositions());
            if (oid != null)
            {
                Object id = oid;
                if (!pcClassForObject.getName().equals(oid.getPcClass()))
                {
                    // Get an OID for the right inheritance level
                    id = OIDFactory.getInstance(ec.getNucleusContext(), pcClassForObject.getName(), oid.getKeyValue());
                }

                if (warnMsg != null)
                {
                    NucleusLogger.DATASTORE_RETRIEVE.warn(warnMsg);
View Full Code Here

Examples of org.datanucleus.identity.OID

        ApiAdapter api = getApiAdapter();
        List<AbstractClassMetaData> rootCmds = new ArrayList<AbstractClassMetaData>();
        if (id instanceof OID)
        {
            // Datastore Identity, so identity is an OID, and the object is of the target class or a subclass
            OID oid = (OID) id;
            AbstractClassMetaData cmd = getMetaDataManager().getMetaDataForClass(oid.getPcClass(), clr);
            rootCmds.add(cmd);
            if (cmd.getIdentityType() != IdentityType.DATASTORE)
            {
                throw new NucleusUserException(LOCALISER_RDBMS.msg("050022", id, cmd.getFullClassName()));
            }
View Full Code Here

Examples of org.datanucleus.identity.OID

                    else if (cmd.getIdentityType() == IdentityType.DATASTORE)
                    {
                        // Datastore identity
                        SQLExpression source = (secondIsLiteral ? expr1.subExprs.getExpression(0) : expr2.subExprs.getExpression(0));
                        JavaTypeMapping mapping = (secondIsLiteral ? expr1.mapping : expr2.mapping);
                        OID objectId = (OID)api.getIdForObject(value);
                        if (objectId == null)
                        {
                            // PC object with no id (embedded, or transient maybe)
                            // Query should return nothing (so just do "(1 = 0)")
                            NucleusLogger.QUERY.warn(LOCALISER.msg("037003", value));
                            // TODO Allow for !equals
                            return exprFactory.newLiteral(stmt, mapping, false).eq(exprFactory.newLiteral(stmt, mapping, true));
                            // It is arguable that we should compare the id with null (as below)
                            /*bExpr = expr.eq(new NullLiteral(qs));*/
                        }
                        else
                        {
                            JavaTypeMapping m = storeMgr.getSQLExpressionFactory().getMappingForType(
                                objectId.getKeyValue().getClass(), false);
                            SQLExpression oidExpr = exprFactory.newLiteral(stmt, m, objectId.getKeyValue());
                            if (equals)
                            {
                                return source.eq(oidExpr);
                            }
                            else
View Full Code Here

Examples of org.datanucleus.identity.OID

                            stmt.getQueryGenerator().getClassLoaderResolver());
                    if (cmd.getIdentityType() == IdentityType.DATASTORE)
                    {
                        try
                        {
                            OID oid = OIDFactory.getInstance(stmt.getRDBMSManager().getNucleusContext(), oidString);
                            if (oid == null)
                            {
                                // TODO Implement this comparison with the key value
                            }
                        }
View Full Code Here

Examples of org.datanucleus.identity.OID

            getDatastoreMapping(0).setObject(ps, param[0], null);
        }
        else
        {
            ApiAdapter api = ec.getApiAdapter();
            OID oid;
            if (api.isPersistable(value))
            {
                oid = (OID) api.getIdForObject(value);
                if (oid == null)
                {
                    if (ec.isInserting(value))
                    {
                        // Object is in the process of being inserted, but has no id yet so provide a null for now
                        // The "NotYetFlushedException" is caught by ParameterSetter and processed as an update being required.
                        getDatastoreMapping(0).setObject(ps, param[0], null);
                        throw new NotYetFlushedException(value);
                    }
                    else
                    {
                        // Object is not persist, nor in the process of being made persistent
                        ec.persistObjectInternal(value, null, -1, ObjectProvider.PC);
                        ec.flushInternal(false);
                    }
                }
                oid = (OID) api.getIdForObject(value);
            }
            else
            {
                oid = (OID) value;
            }

            try
            {
                // Try as a Long
                getDatastoreMapping(0).setObject(ps,param[0],oid.getKeyValue());
            }
            catch (Exception e)
            {
                // Must be a String
                getDatastoreMapping(0).setObject(ps,param[0],oid.getKeyValue().toString());
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.