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

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


       
        if (LOG.isDebugEnabled()) {
            LOG.debug("removing collection adapter(s) from oid map");
        }
        for (final ObjectAdapter collectionAdapter : rootAndCollectionAdapters) {
            final Oid collectionOid = collectionAdapter.getOid();
            removed = oidAdapterMap.remove(collectionOid);
            if (!removed) {
                LOG.warn("could not remove collectionOid: " + collectionOid);
                // should we fail here with a more serious error?
            }
View Full Code Here


            }
        }
    }

    private void remapAggregatedObject(final ObjectAdapter adapter, final RootOid persistedRootOid) {
        final Oid oid = adapter.getOid();
        if (!(oid instanceof AggregatedOid) || !oid.isTransient()) {
                return;
        }
        AggregatedOid aoid = (AggregatedOid) oid;
        AggregatedOid childOid = new AggregatedOid(aoid.getObjectSpecId(), persistedRootOid, aoid.getLocalId());
        adapter.replaceOid(childOid);
View Full Code Here

    }

    private void unmap(final ObjectAdapter adapter) {
        ensureMapsConsistent(adapter);

        final Oid oid = adapter.getOid();
        if (oid != null) {
            oidAdapterMap.remove(oid);
        }
        pojoAdapterMap.remove(adapter);
    }
View Full Code Here

                adapter, is(adapterAccordingToPojoAdapterMap),
                "mismatch in PojoAdapterMap: provided adapter's OID: " + adapter.getOid() + "; \n" + " but map's adapter's OID was : " + adapterAccordingToPojoAdapterMap.getOid());
    }

    private void ensureOidAdapterMapConsistent(final ObjectAdapter adapter) {
        final Oid adapterOid = adapter.getOid();
        final ObjectAdapter adapterAccordingToOidAdapterMap = oidAdapterMap.getAdapter(adapterOid);
        // take care not to touch the pojo, since it might have been deleted.
        ensureThatArg(
                adapter, is(adapterAccordingToOidAdapterMap),
                "mismatch in OidAdapter map: " + "adapter's Oid: " + adapterOid + ", " + "provided adapter's OID: " + adapter.getOid() + "; " + "map's adapter's Oid: " + adapterAccordingToOidAdapterMap.getOid());
View Full Code Here

                public String toString(Object object) {
                    if(object == null) {
                        return null;
                    }
                    final ObjectAdapter adapter = getAdapterManager().adapterFor(object);
                    Oid oid = adapter.getOid();
                    return oid != null? oid.enString(getOidMarshaller()): encodedValueOf(adapter);
                }
                private String encodedValueOf(ObjectAdapter adapter) {
                    EncodableFacet facet = adapter.getSpecification().getFacet(EncodableFacet.class);
                    return facet != null? facet.toEncodedString(adapter): adapter.toString();
                }
View Full Code Here

    private ObjectAdapter createCollectionAdapter(final Object pojo, final ObjectAdapter parentAdapter, final OneToManyAssociation otma) {

        ensureMapsConsistent(parentAdapter);
        Assert.assertNotNull(pojo);

        final Oid parentOid = parentAdapter.getOid();

        // persistence of collection follows the parent
        final CollectionOid collectionOid = new CollectionOid((TypedOid) parentOid, otma);
        final ObjectAdapter collectionAdapter = createCollectionAdapterAndInferResolveState(pojo, collectionOid);
View Full Code Here

                throw new PojoRecreationException(typedOid, ex);
            }
        }

        // sync versions of original, with concurrency checking if required
        Oid adapterOid = adapter.getOid();
        if(adapterOid instanceof RootOid) {
            final RootOid recreatedOid = (RootOid) adapterOid;
            final RootOid originalOid = (RootOid) typedOid;
           
            try {
View Full Code Here

       
        if (LOG.isDebugEnabled()) {
            LOG.debug("removing collection adapter(s) from oid map");
        }
        for (final ObjectAdapter collectionAdapter : rootAndCollectionAdapters) {
            final Oid collectionOid = collectionAdapter.getOid();
            removed = oidAdapterMap.remove(collectionOid);
            if (!removed) {
                LOG.warn("could not remove collectionOid: " + collectionOid);
                // should we fail here with a more serious error?
            }
View Full Code Here

            }
        }
    }

    private void remapAggregatedObject(final ObjectAdapter adapter, final RootOid persistedRootOid) {
        final Oid oid = adapter.getOid();
        if (!(oid instanceof AggregatedOid) || !oid.isTransient()) {
                return;
        }
        AggregatedOid aoid = (AggregatedOid) oid;
        AggregatedOid childOid = new AggregatedOid(aoid.getObjectSpecId(), persistedRootOid, aoid.getLocalId());
        adapter.replaceOid(childOid);
View Full Code Here

            idMapping.appendUpdateValues(connector, sql, parentAdapter);
           
            final Results rs = connector.select(sql.toString());
            final List<ObjectAdapter> list = new ArrayList<ObjectAdapter>();
            while (rs.next()) {
                final Oid oid = idMapping.recreateOid(rs, specification);
                final ObjectAdapter element = getAdapter(specification, oid);
                loadFields(element, rs);
                if(LOG.isDebugEnabled()) {
                    LOG.debug("  element  " + element.getOid());
                }
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.