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

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


                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");
                }

                final ObjectMapping mapping = objectMappingLookup.getMapping(parent, connection);
                if (!mapping.saveCollection(connection, parent, collectionOid.getName())) {
                    final ObjectMapping parentMapping = objectMappingLookup.getMapping(parent, connection);
                    parentMapping.save(connection, collectionAdapter);
                }
            }
View Full Code Here


        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);

        // we copy over the type onto the adapter itself
        // [not sure why this is really needed, surely we have enough info in
        // the adapter
View Full Code Here

        final ObjectAdapter createdAdapter;
        if(oid instanceof RootOid) {
            final RootOid rootOid = (RootOid) oid;
            createdAdapter = createRootAdapterAndInferResolveState(pojo, rootOid);
        } else if (oid instanceof CollectionOid){
            final CollectionOid collectionOid = (CollectionOid) oid;
            createdAdapter = createCollectionAdapterAndInferResolveState(pojo, collectionOid);
        } else {
            final AggregatedOid aggregatedOid = (AggregatedOid) oid;
            createdAdapter = createAggregatedAdapter(pojo, aggregatedOid);
        }
View Full Code Here

        // associate the collection adapters with new Oids, and re-map
        if (LOG.isDebugEnabled()) {
            LOG.debug("replacing Oids for collection adapter(s) and re-adding into maps");
        }
        for (final ObjectAdapter collectionAdapter : rootAndCollectionAdapters) {
            final CollectionOid previousCollectionOid = (CollectionOid) collectionAdapter.getOid();
            final CollectionOid persistedCollectionOid = previousCollectionOid.asPersistent(persistedRootOid);
            oidAdapterMap.add(persistedCollectionOid, collectionAdapter);
        }

       
        // some object store implementations may replace collection instances (eg ORM may replace with a cglib-enhanced
View Full Code Here

TOP

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

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.