Package org.apache.isis.core.metamodel.adapter.oid

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


        epvSpecification = iswf.loadSpecification(SimpleEntity.class);
    }

    @Test
    public void getOidForServices() throws Exception {
        final Oid oidForService = getStore().getOidForService(iswf.loadSpecification(ParentEntityRepository.class));
        assertEquals(RootOidDefault.create(ObjectSpecId.of("ParentEntities"), "2"), oidForService);
    }
View Full Code Here


    private OidUtils() {
    }

    public static String getDomainType(final ObjectAdapter objectAdapter) {
        Oid oid = objectAdapter.getOid();
        if (oid == null || !(oid instanceof TypedOid)) {
            return null;
        }
        TypedOid typedOid = (TypedOid) oid;
        return typedOid.getObjectSpecId().asString();
View Full Code Here

        return oidStr != null ? getOidMarshaller().splitInstanceId(oidStr): null;
    }

   
    public static String getOidStr(final RendererContext renderContext, final ObjectAdapter objectAdapter) {
        final Oid oid = objectAdapter.getOid();
        if (!(oid instanceof RootOid)) {
            throw new IllegalArgumentException("objectAdapter must be a root adapter");
        }
        return oid != null ? oid.enStringNoVersion(getOidMarshaller()) : null;
    }
View Full Code Here

            private void saveParentedCollectionAdapter(final ObjectAdapter collectionAdapter,
                final DatabaseConnector connection) {
                final ObjectAdapter parent = collectionAdapter.getAggregateRoot();
                LOG.debug("change to internal collection being persisted through parent");

                final Oid oid = collectionAdapter.getOid();
                final CollectionOid collectionOid = (CollectionOid) oid;
                if (!(oid instanceof CollectionOid)) {
                    throw new IsisAssertException("object should have a CollectionOid");
                }
View Full Code Here

    }

    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

    private Data createReferenceData(final ObjectAdapter referencedAdapter) {
        if (referencedAdapter == null) {
            return null;
        }

        final Oid refOid = referencedAdapter.getOid();
        if (refOid == null) {
            return createStandaloneData(referencedAdapter);
        }

        if ((referencedAdapter.getSpecification().isParented() || refOid.isTransient()) && !transientObjects.contains(refOid)) {
            transientObjects.add(refOid);
            return createObjectData(referencedAdapter);
        }

        final String specification = referencedAdapter.getSpecification().getFullIdentifier();
View Full Code Here

        final ObjectSpecification spec =
                getSpecificationLoader().loadSpecification(data.getClassName());

        ObjectAdapter adapter;
       
        final Oid oid = getOid();
    if (spec.isParentedOrFreeCollection()) {
         
          final Object recreatedPojo = spec.createObject();
          adapter = getPersistenceSession().mapRecreatedPojo(oid, recreatedPojo);
            populateCollection(adapter, (CollectionData) data);
View Full Code Here

            return standaloneData.getAdapter();
        }
       
        // reference to entity
       
        Oid oid = data.getOid();
        Assert.assertTrue("can only create a reference to an entity", oid instanceof TypedOid);
       
    final TypedOid typedOid = (TypedOid) oid;
        if (typedOid == null) {
            return null;
View Full Code Here

        }
    }

    @Override
    public void resolveImmediately(final ObjectAdapter adapter) {
        final Oid oid = adapter.getOid();
        if (!(oid instanceof AggregatedOid)) {
            final ObjectSpecification objectSpec = adapter.getSpecification();
            final String key = keyCreator.getIdentifierForPersistentRoot(oid);
            final StateReader reader = database.getInstance(key, objectSpec.getSpecId());
            objectReader.update(reader, versionCreator, availableDataEncrypters, adapter);
View Full Code Here

    private static final long serialVersionUID = 1L;
   
    private final String oidStr;

    public RootAdapterMappingAbstract(final ObjectAdapter adapter) {
        final Oid oid = adapter.getOid();
        oidStr = oid.enString(getOidMarshaller());
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.adapter.oid.Oid

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.