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

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


   
    private final Map<OneToManyAssociation, ObjectAdapter> collectionAdapters = Maps.newLinkedHashMap();

    public RootAndCollectionAdapters(ObjectAdapter parentAdapter, AdapterManager objectAdapterLookup) {
        Assert.assertNotNull(parentAdapter);
        final Oid oid = parentAdapter.getOid();
        this.parentAdapter = parentAdapter;
        this.rootAdapterOid = (RootOid) oid;
        addCollectionAdapters(objectAdapterLookup);
    }
View Full Code Here


        return adapter.getObject();
    }

    public Bookmark bookmarkFor(Object domainObject) {
        final ObjectAdapter adapter = adapterFor(domainObject);
        final Oid oid = adapter.getOid();
        if(oid == null) {
            // values cannot be bookmarked
            return null;
        }
        if(!(oid instanceof RootOid)) {
View Full Code Here

    public ObjectAdapter getAggregateRoot() {
        if(!isParented()) {
            return this;
        }
        ParentedOid parentedOid = (ParentedOid) oid;
        final Oid parentOid = parentedOid.getParentOid();
        ObjectAdapter parentAdapter = objectAdapterLookup.getAdapterFor(parentOid);
        if(parentAdapter == null) {
            final Oid parentOidNowPersisted = getPersistenceSession().remappedFrom(parentOid);
            parentAdapter = objectAdapterLookup.getAdapterFor(parentOidNowPersisted);
        }
        return parentAdapter;
    }
View Full Code Here

        if(isParented()) {
            getAggregateRoot().checkLock(otherVersion);
            return;
        }
       
        Oid thisOid = getOid();
        final Version thisVersion = thisOid.getVersion();
       
        // check for exception, but don't throw if suppressed through thread-local
        if(thisVersion != null &&
           otherVersion != null &&
           thisVersion.different(otherVersion)) {
View Full Code Here

        return defaultTitle;
    }

    protected void toString(final ToString str) {
        str.append(aggregateResolveState().code());
        final Oid oid = getOid();
        if (oid != null) {
            str.append(":");
            str.append(oid.toString());
        } else {
            str.append(":-");
        }
        str.setAddComma();
        if (getSpecificationNoLoad() == null) {
View Full Code Here

        String argsStr = argsBuf.toString();
        return argsStr;
    }

    public static Bookmark bookmarkFor(final ObjectAdapter adapter) {
        final Oid oid = adapter.getOid();
        if(!(oid instanceof RootOid)) {
            return null;
        }
        final RootOid rootOid = (RootOid) oid;
        return rootOid.asBookmark();
View Full Code Here

     *
     * @see #remapAsPersistent(ObjectAdapter)
     */
    @Override
    public void remapAsPersistent(final ObjectAdapter adapter) {
        final Oid transientOid = adapter.getOid();
        adapterManager.remapAsPersistent(adapter, null);
        final Oid persistentOid = adapter.getOid();
        persistentByTransient.put(transientOid, persistentOid);
    }
View Full Code Here

        for (final Object servicePojo : servicesInjector.getRegisteredServices()) {
            final String id = ServiceUtil.id(servicePojo);
            final Class<? extends Object> serviceClass = servicePojo.getClass();
            final ObjectSpecification serviceSpecification = getSpecificationLoader().loadSpecification(serviceClass);
            final String serviceClassName = serviceClass.getName();
            final Oid oidForService = getOidForService(serviceSpecification);
            final String serviceId = id + (id.equals(serviceClassName) ? "" : " (" + serviceClassName + ")");
            debug.appendln(oidForService != null ? oidForService.toString() : "[NULL]", serviceId);
        }
        debug.appendln();

        debug.appendTitle("Persistor");
        getTransactionManager().debugData(debug);
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 ObjectNotFoundException(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

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.