You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/09/08 08:51:18 UTC

[07/12] isis git commit: ISIS-1194: simplified the Oid hierarchy to just two : RootOid and ParentedCollectionOid

ISIS-1194: simplified the Oid hierarchy to just two : RootOid and ParentedCollectionOid

* RootOid is the rename of RootOidDefault, and incorporates the original RootOid interface and the TypedOid interface.  (TypedOid previously was also a supertype of AggregatedOid, but this was removed in a previous commit).
* ParentedCollectionOid is the rename of CollectionOid, and incorporates the original ParentOid supertype interface.  (ParentOid previously was  also a supertype of AggregatedOid, but this was removed in a previous commit).


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/c3f880b7
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/c3f880b7
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/c3f880b7

Branch: refs/heads/master
Commit: c3f880b784b8bafa619f04c28789793e470b6267
Parents: a5c2de7
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Sep 7 20:49:58 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Sep 7 20:49:58 2015 +0100

----------------------------------------------------------------------
 .../core/metamodel/adapter/ObjectAdapter.java   |   6 +-
 .../metamodel/adapter/mgr/AdapterManager.java   |  18 +-
 .../metamodel/adapter/oid/CollectionOid.java    | 165 -----------
 .../isis/core/metamodel/adapter/oid/Oid.java    |   6 +-
 .../metamodel/adapter/oid/OidMarshaller.java    |  27 +-
 .../adapter/oid/ParentedCollectionOid.java      | 210 +++++++++++++
 .../core/metamodel/adapter/oid/ParentedOid.java |  83 ------
 .../core/metamodel/adapter/oid/RootOid.java     | 292 +++++++++++++++++--
 .../metamodel/adapter/oid/RootOidDefault.java   | 292 -------------------
 .../core/metamodel/adapter/oid/TypedOid.java    |  29 --
 .../ParentedCollectionFacetDefault.java         |  37 +++
 .../parented/ParentedFacetSinceCollection.java  |  31 --
 .../ParentedFacetSinceCollectionFactory.java    |   6 +-
 .../parented/ParentedCollectionFacet.java       |  40 +++
 .../ParentedCollectionFacetAbstract.java        |  36 +++
 .../facets/object/parented/ParentedFacet.java   |  56 ----
 .../object/parented/ParentedFacetAbstract.java  |  36 ---
 .../aggregated/AggregatedAnnotationFactory.java |  72 +++++
 .../ParentedFacetSinceAggregatedAnnotation.java |  31 --
 ...edFacetSinceAggregatedAnnotationFactory.java |  71 -----
 ...creatableObjectFacetDeclarativeAbstract.java |   7 +-
 ...ueFacetAnnotationOrConfigurationFactory.java |   4 +-
 .../noruntime/RuntimeContextNoRuntime.java      |  21 +-
 .../container/DomainObjectContainerDefault.java |   2 +-
 .../metamodel/spec/ObjectSpecification.java     |   5 +-
 .../specimpl/ObjectSpecificationAbstract.java   |   4 +-
 .../validator/JdoMetaModelValidator.java        |   4 +-
 .../dflt/ProgrammingModelFacetsJava5.java       |   4 +-
 .../oid/CollectionOidTest_valueSemantics.java   |  20 +-
 .../adapter/oid/OidMarshallerTest_marshall.java |  20 +-
 .../oid/OidMarshallerTest_roundtripping.java    |  22 +-
 .../oid/OidMarshallerTest_unmarshal.java        |  32 +-
 .../metamodel/adapter/oid/OidVersionTest.java   |  32 +-
 .../adapter/oid/RootOidDefaultTest_create.java  |  77 -----
 ...faultTest_valueSemantics_whenPersistent.java |  18 +-
 ...efaultTest_valueSemantics_whenTransient.java |  18 +-
 .../adapter/oid/RootOidTest_create.java         |  77 +++++
 ...cetSinceAggregatedAnnotationFactoryTest.java |  60 ----
 .../AggregatedAnnotationFactoryTest.java        |  58 ++++
 ...inObjectContainerDefaultTest_recognizes.java |  14 +-
 .../apache/isis/core/runtime/memento/Data.java  |   6 +-
 .../isis/core/runtime/memento/Memento.java      |  33 +--
 .../persistence/adapter/PojoAdapter.java        |  32 +-
 .../adaptermanager/AdapterManagerDefault.java   |  41 ++-
 .../adaptermanager/PojoRecreator.java           |   4 +-
 .../adaptermanager/PojoRecreatorDefault.java    |  14 +-
 .../PojoRecreatorForDataNucleus.java            |   4 +-
 .../adaptermanager/PojoRecreatorUnified.java    |   4 +-
 .../RootAndCollectionAdapters.java              |  17 +-
 .../container/DomainObjectContainerResolve.java |   3 +-
 .../internal/RuntimeContextFromSession.java     |   6 +-
 .../algorithm/PersistAlgorithmAbstract.java     |   2 +-
 .../background/BackgroundCommandExecution.java  |   3 +-
 .../runtime/system/persistence/ObjectStore.java |  19 +-
 .../system/persistence/OidGenerator.java        |   9 +-
 .../system/persistence/PersistenceSession.java  |   8 +-
 .../jdo/datanucleus/DataNucleusObjectStore.java |  14 +-
 .../persistence/AggregatedFacetAlways.java      |   4 +-
 .../adapterfactory/pojo/PojoAdapterTest.java    |  12 +-
 ...AdapterManagerDefault_aggregateAdapters.java |  13 +-
 .../transaction/PojoAdapterBuilder.java         |   9 +-
 .../restfulobjects/rendering/util/OidUtils.java |   9 +-
 .../restfulobjects/server/util/OidUtils.java    |   6 +-
 .../wicket/ConverterForObjectAdapter.java       |   4 +-
 .../ConverterForObjectAdapterMemento.java       |   3 +-
 .../model/mementos/ObjectAdapterMemento.java    |   3 +-
 .../viewer/wicket/model/models/ActionModel.java |   3 +-
 .../ObjectAdapterMementoProviderAbstract.java   |   3 +-
 68 files changed, 1057 insertions(+), 1274 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
index 86ecea6..20169e5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
@@ -32,7 +32,7 @@ import org.apache.isis.core.commons.lang.ListExtensions;
 import org.apache.isis.core.commons.lang.MethodExtensions;
 import org.apache.isis.core.commons.lang.MethodUtil;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.adapter.oid.CollectionOid;
+import org.apache.isis.core.metamodel.adapter.oid.ParentedCollectionOid;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
 import org.apache.isis.core.metamodel.adapter.version.Version;
@@ -184,9 +184,9 @@ public interface ObjectAdapter extends Instance, org.apache.isis.applib.annotati
 
     /**
      * Whether this instance belongs to another object (meaning its
-     * {@link #getOid()} will be a {@link CollectionOid}).
+     * {@link #getOid()} will be a {@link ParentedCollectionOid}).
      */
-    boolean isParented();
+    boolean isParentedCollection();
 
 
     /**

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java
index b6c1402..9b8df59 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/mgr/AdapterManager.java
@@ -25,7 +25,7 @@ import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.core.commons.components.Injectable;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
-import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
 import org.apache.isis.core.metamodel.adapter.version.Version;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -138,7 +138,7 @@ public interface AdapterManager extends Injectable {
     }
 
     /**
-     * As per {@link #adapterFor(TypedOid, ConcurrencyChecking)}, with
+     * As per {@link #adapterFor(RootOid, ConcurrencyChecking)}, with
      * {@link org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking#NO_CHECK no checking}.
      *
      * <p>
@@ -146,7 +146,7 @@ public interface AdapterManager extends Injectable {
      * know that the oid does indeed represent an object you know exists.
      * </p>
      */
-    ObjectAdapter adapterFor(TypedOid oid);
+    ObjectAdapter adapterFor(RootOid oid);
     
 
     /**
@@ -167,23 +167,19 @@ public interface AdapterManager extends Injectable {
      * in order to ensure that the created pojo is attached to a persistence context.
      * 
      * <p>
-     * If the {@link ObjectAdapter adapter} is recreated, its
-     * {@link ResolveState} will be set to {@link ResolveState#GHOST}.
-     *
-     * <p>
      * The {@link ConcurrencyChecking} parameter determines whether concurrency checking is performed.
      * If it is requested, then a check is made to ensure that the {@link Oid#getVersion() version} 
-     * of the {@link TypedOid oid} of the recreated adapter is the same as that of the provided {@link TypedOid oid}.
+     * of the {@link RootOid oid} of the recreated adapter is the same as that of the provided {@link RootOid oid}.
      * If the version differs, then a {@link ConcurrencyException} is thrown.
      * 
      * <p>
-     * ALSO, even if a {@link ConcurrencyException}, then the provided {@link TypedOid oid}'s {@link Version version}
-     * will be {@link TypedOid#setVersion(org.apache.isis.core.metamodel.adapter.version.Version) set} to the current 
+     * ALSO, even if a {@link ConcurrencyException}, then the provided {@link RootOid oid}'s {@link Version version}
+     * will be {@link RootOid#setVersion(org.apache.isis.core.metamodel.adapter.version.Version) set} to the current
      * value.  This allows the client to retry if they wish.
      * 
      * @throws {@link org.apache.isis.core.runtime.persistence.ObjectNotFoundException} if the object does not exist.
      */
-    ObjectAdapter adapterFor(TypedOid oid, ConcurrencyChecking concurrencyChecking);
+    ObjectAdapter adapterFor(RootOid oid, ConcurrencyChecking concurrencyChecking);
 
     /**
      * Looks up or creates a standalone (value) or root adapter.

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/CollectionOid.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/CollectionOid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/CollectionOid.java
deleted file mode 100644
index 7cb47e3..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/CollectionOid.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.adapter.oid;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import com.google.common.base.Objects;
-
-import org.apache.isis.core.commons.encoding.DataInputExtended;
-import org.apache.isis.core.commons.encoding.DataOutputExtended;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-
-/**
- * Used as the {@link Oid} for collections.
- */
-public final class CollectionOid extends ParentedOid implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private final String name;
-    private int cachedHashCode;
-
-    // /////////////////////////////////////////////////////////
-    // Constructor
-    // /////////////////////////////////////////////////////////
-
-    public CollectionOid(TypedOid parentOid, OneToManyAssociation otma) {
-        this(parentOid, otma.getId());
-    }
-
-    public CollectionOid(TypedOid parentOid, String name) {
-        super(parentOid);
-        this.name = name;
-        cacheState();
-    }
-
-    
-    // /////////////////////////////////////////////////////////
-    // enstring
-    // /////////////////////////////////////////////////////////
-
-    public static CollectionOid deString(String oidStr, OidMarshaller oidMarshaller) {
-        return oidMarshaller.unmarshal(oidStr, CollectionOid.class);
-    }
-
-
-    @Override
-    public String enString(OidMarshaller oidMarshaller) {
-        return oidMarshaller.marshal(this);
-    }
-
-    @Override
-    public String enStringNoVersion(OidMarshaller oidMarshaller) {
-        return oidMarshaller.marshalNoVersion(this);
-    }
-
-
-    // /////////////////////////////////////////////////////////
-    // encodeable
-    // /////////////////////////////////////////////////////////
-
-
-    public CollectionOid(DataInputExtended inputStream) throws IOException {
-        this(CollectionOid.deString(inputStream.readUTF(), getEncodingMarshaller()));
-    }
-
-    private CollectionOid(CollectionOid oid) throws IOException {
-        super(oid.getParentOid());
-        this.name = oid.name;
-    }
-
-
-    @Override
-    public void encode(DataOutputExtended outputStream) throws IOException {
-        outputStream.writeUTF(enString(getEncodingMarshaller()));
-    }
-
-    /**
-     * Cannot be a reference because Oid gets serialized by wicket viewer
-     */
-    private static OidMarshaller getEncodingMarshaller() {
-        return new OidMarshaller();
-    }
-
-    // /////////////////////////////////////////////////////////
-    // Properties
-    // /////////////////////////////////////////////////////////
-
-    public String getName() {
-        return name;
-    }
-
-
-    // /////////////////////////////////////////////////////////
-    // Value semantics
-    // /////////////////////////////////////////////////////////
-
-    @Override
-    public boolean equals(final Object other) {
-        if (other == this) {
-            return true;
-        }
-        if (other == null) {
-            return false;
-        }
-        if (getClass() != other.getClass()) {
-            return false;
-        }
-        return equals((CollectionOid) other);
-    }
-
-    public boolean equals(final CollectionOid other) {
-        return Objects.equal(other.getParentOid(), getParentOid()) && Objects.equal(other.name, name);
-    }
-
-    
-    @Override
-    public int hashCode() {
-        cacheState();
-        return cachedHashCode;
-    }
-
-    private void cacheState() {
-        int hashCode = 17;
-        hashCode = 37 * hashCode + getParentOid().hashCode();
-        hashCode = 37 * hashCode + name.hashCode();
-        cachedHashCode = hashCode;
-    }
-
-
-    
-    // /////////////////////////////////////////////////////////
-    // asPersistent
-    // /////////////////////////////////////////////////////////
-
-    /**
-     * When the RootOid is persisted, all its &quot;children&quot;
-     * need updating similarly.
-     */
-    public CollectionOid asPersistent(TypedOid newParentRootOid) {
-        return new CollectionOid(newParentRootOid, name);
-    }
-
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java
index 7e54e7d..5d70c19 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java
@@ -31,7 +31,7 @@ import org.apache.isis.core.metamodel.adapter.version.Version;
 
 /**
  * An immutable identifier for either a root object (subtype {@link RootOid}) or 
- * an aggregated object (subtype {@link AggregatedOid}).
+ * a parented collection (subtype {@link ParentedCollectionOid}).
  * 
  * <p>
  * Note that value objects (strings, ints, {@link Value}s etc) do not have an {@link Oid}. 
@@ -54,8 +54,8 @@ public interface Oid extends Encodable {
      * or a view model object, or for a persistent object.
      * 
      * <p>
-     * In the case of an {@link AggregatedOid}, is determined by the state 
-     * of its {@link AggregatedOid#getParentOid() parent}'s {@link RootOid#isTransient() state}.
+     * In the case of an {@link ParentedCollectionOid}, is determined by the state
+     * of its {@link ParentedCollectionOid#getRootOid() root}'s {@link RootOid#isTransient() state}.
      */
     boolean isTransient();
 

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshaller.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshaller.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshaller.java
index 843a9d3..03712bb 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshaller.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshaller.java
@@ -156,8 +156,6 @@ public class OidMarshaller {
             state = State.PERSISTENT;
         }
         
-        final String rootOidStr = getGroup(matcher, 2);
-        
         final String rootObjectType = getGroup(matcher, 4);
         final String rootIdentifier = getGroup(matcher, 5);
         
@@ -187,8 +185,8 @@ public class OidMarshaller {
 
         if(collectionName == null) {
             if(aggregateOidParts.isEmpty()) {
-                ensureCorrectType(oidStr, requestedType, RootOidDefault.class); 
-                return (T)new RootOidDefault(ObjectSpecId.of(rootObjectType), rootIdentifier, state, version);
+                ensureCorrectType(oidStr, requestedType, RootOid.class);
+                return (T)new RootOid(ObjectSpecId.of(rootObjectType), rootIdentifier, state, version);
             } else {
                 throw new RuntimeException("Aggregated Oids are no longer supported");
             }
@@ -197,9 +195,9 @@ public class OidMarshaller {
             
             final String parentOidStr = oidStrWithoutCollectionName + marshal(version);
 
-            TypedOid parentOid = this.unmarshal(parentOidStr, TypedOid.class);
-            ensureCorrectType(oidStr, requestedType, CollectionOid.class);
-            return (T)new CollectionOid(parentOid, collectionName);
+            RootOid parentOid = this.unmarshal(parentOidStr, RootOid.class);
+            ensureCorrectType(oidStr, requestedType, ParentedCollectionOid.class);
+            return (T)new ParentedCollectionOid(parentOid, collectionName);
         }
     }
 
@@ -218,15 +216,6 @@ public class OidMarshaller {
     }
     
 
-    private TypedOid parentOidFor(final String rootOidStr, final List<AggregateOidPart> aggregateOidParts, Version version) {
-        final StringBuilder buf = new StringBuilder(rootOidStr);
-        for(AggregateOidPart part: aggregateOidParts) {
-            buf.append(part.toString());
-        }
-        buf.append(marshal(version));
-        return unmarshal(buf.toString(), TypedOid.class);
-    }
-
     private <T> void ensureCorrectType(String oidStr, Class<T> requestedType, final Class<? extends Oid> actualType) {
         if(!requestedType.isAssignableFrom(actualType)) {
             throw new IllegalArgumentException("OID '" + oidStr + "' does not represent a " +
@@ -258,12 +247,12 @@ public class OidMarshaller {
         return transientIndicator + viewModelIndicator + rootOid.getObjectSpecId() + SEPARATOR + rootOid.getIdentifier();
     }
 
-    public final String marshal(CollectionOid collectionOid) {
+    public final String marshal(ParentedCollectionOid collectionOid) {
         return marshalNoVersion(collectionOid) + marshal(collectionOid.getVersion());
     }
 
-    public String marshalNoVersion(CollectionOid collectionOid) {
-        return collectionOid.getParentOid().enStringNoVersion(this) + SEPARATOR_COLLECTION + collectionOid.getName();
+    public String marshalNoVersion(ParentedCollectionOid collectionOid) {
+        return collectionOid.getRootOid().enStringNoVersion(this) + SEPARATOR_COLLECTION + collectionOid.getName();
     }
 
     public final String marshal(Version version) {

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedCollectionOid.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedCollectionOid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedCollectionOid.java
new file mode 100644
index 0000000..0745555
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedCollectionOid.java
@@ -0,0 +1,210 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.adapter.oid;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import com.google.common.base.Objects;
+
+import org.apache.isis.core.commons.encoding.DataInputExtended;
+import org.apache.isis.core.commons.encoding.DataOutputExtended;
+import org.apache.isis.core.commons.ensure.Assert;
+import org.apache.isis.core.metamodel.adapter.version.Version;
+import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
+
+/**
+ * Used as the {@link Oid} for collections.
+ */
+public final class ParentedCollectionOid implements Serializable, Oid {
+
+    private static final long serialVersionUID = 1L;
+
+    private final String name;
+    private int cachedHashCode;
+
+    private final RootOid parentOid;
+
+    // /////////////////////////////////////////////////////////
+    // Constructor
+    // /////////////////////////////////////////////////////////
+
+    public ParentedCollectionOid(RootOid rootOid, OneToManyAssociation otma) {
+        this(rootOid, otma.getId());
+    }
+
+    public ParentedCollectionOid(RootOid rootOid, String name) {
+        Assert.assertNotNull("rootOid required", rootOid);
+        this.parentOid = rootOid;
+        this.name = name;
+        cacheState();
+    }
+
+
+    public RootOid getRootOid() {
+        return parentOid;
+    }
+
+    @Override
+    public Version getVersion() {
+        return parentOid.getVersion();
+    }
+
+    @Override
+    public void setVersion(Version version) {
+        parentOid.setVersion(version);
+    }
+
+    @Override
+    public boolean isTransient() {
+        return getRootOid().isTransient();
+    }
+
+    @Override
+    public boolean isViewModel() {
+        return getRootOid().isViewModel();
+    }
+
+    @Override
+    public boolean isPersistent() {
+        return getRootOid().isPersistent();
+    }
+
+
+    // /////////////////////////////////////////////////////////
+    // enstring
+    // /////////////////////////////////////////////////////////
+
+    public static ParentedCollectionOid deString(String oidStr, OidMarshaller oidMarshaller) {
+        return oidMarshaller.unmarshal(oidStr, ParentedCollectionOid.class);
+    }
+
+
+    @Override
+    public String enString(OidMarshaller oidMarshaller) {
+        return oidMarshaller.marshal(this);
+    }
+
+    @Override
+    public String enStringNoVersion(OidMarshaller oidMarshaller) {
+        return oidMarshaller.marshalNoVersion(this);
+    }
+
+
+    // /////////////////////////////////////////////////////////
+    // encodeable
+    // /////////////////////////////////////////////////////////
+
+
+    public ParentedCollectionOid(DataInputExtended inputStream) throws IOException {
+        this(ParentedCollectionOid.deString(inputStream.readUTF(), getEncodingMarshaller()));
+    }
+
+    private ParentedCollectionOid(ParentedCollectionOid oid) throws IOException {
+        this.parentOid = oid.getRootOid();
+        this.name = oid.name;
+    }
+
+
+    @Override
+    public void encode(DataOutputExtended outputStream) throws IOException {
+        outputStream.writeUTF(enString(getEncodingMarshaller()));
+    }
+
+    /**
+     * Cannot be a reference because Oid gets serialized by wicket viewer
+     */
+    private static OidMarshaller getEncodingMarshaller() {
+        return new OidMarshaller();
+    }
+
+    // /////////////////////////////////////////////////////////
+    // Properties
+    // /////////////////////////////////////////////////////////
+
+    public String getName() {
+        return name;
+    }
+
+
+    // /////////////////////////////////////////////////////////
+    // toString
+    // /////////////////////////////////////////////////////////
+
+    @Override
+    public String toString() {
+        return enString(new OidMarshaller());
+    }
+
+
+
+    // /////////////////////////////////////////////////////////
+    // Value semantics
+    // /////////////////////////////////////////////////////////
+
+    @Override
+    public boolean equals(final Object other) {
+        if (other == this) {
+            return true;
+        }
+        if (other == null) {
+            return false;
+        }
+        if (getClass() != other.getClass()) {
+            return false;
+        }
+        return equals((ParentedCollectionOid) other);
+    }
+
+    public boolean equals(final ParentedCollectionOid other) {
+        return Objects.equal(other.getRootOid(), getRootOid()) && Objects.equal(other.name, name);
+    }
+
+
+    @Override
+    public int hashCode() {
+        cacheState();
+        return cachedHashCode;
+    }
+
+    private void cacheState() {
+        int hashCode = 17;
+        hashCode = 37 * hashCode + getRootOid().hashCode();
+        hashCode = 37 * hashCode + name.hashCode();
+        cachedHashCode = hashCode;
+    }
+
+
+
+    // /////////////////////////////////////////////////////////
+    // asPersistent
+    // /////////////////////////////////////////////////////////
+
+    /**
+     * When the RootOid is persisted, all its &quot;children&quot;
+     * need updating similarly.
+     */
+    public ParentedCollectionOid asPersistent(RootOid newParentRootOid) {
+        return new ParentedCollectionOid(newParentRootOid, name);
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedOid.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedOid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedOid.java
deleted file mode 100644
index bfa618d..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/ParentedOid.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.adapter.oid;
-
-import org.apache.isis.core.commons.ensure.Assert;
-import org.apache.isis.core.metamodel.adapter.version.Version;
-
-
-/**
- * Base type of the {@link Oid} for collections and for <tt>@Aggregated</tt>
- * types.
- * 
- * @see AggregatedOid
- * @see CollectionOid
- */
-public abstract class ParentedOid implements Oid {
-
-    private final TypedOid parentOid;
-    
-    public ParentedOid(TypedOid parentOid) {
-        Assert.assertNotNull("parentOid required", parentOid);
-        this.parentOid = parentOid;
-    }
-
-    public TypedOid getParentOid() {
-        return parentOid;
-    }
-
-    @Override
-    public Version getVersion() {
-        return parentOid.getVersion();
-    }
-
-    @Override
-    public void setVersion(Version version) {
-        parentOid.setVersion(version);
-    }
-
-
-    @Override
-    public boolean isTransient() {
-        return getParentOid().isTransient();
-    }
-    
-    @Override
-    public boolean isViewModel() {
-        return getParentOid().isViewModel();
-    }
-    
-    @Override
-    public boolean isPersistent() {
-        return getParentOid().isPersistent();
-    }
-
-
-    // /////////////////////////////////////////////////////////
-    // toString
-    // /////////////////////////////////////////////////////////
-
-    @Override
-    public String toString() {
-        return enString(new OidMarshaller());
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOid.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOid.java
index e565685..d1e7dba 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOid.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOid.java
@@ -19,39 +19,275 @@
 
 package org.apache.isis.core.metamodel.adapter.oid;
 
+import java.io.IOException;
+import java.io.Serializable;
+
+import com.google.common.base.Objects;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.apache.isis.applib.services.bookmark.Bookmark;
+import org.apache.isis.core.commons.encoding.DataInputExtended;
+import org.apache.isis.core.commons.encoding.DataOutputExtended;
+import org.apache.isis.core.commons.ensure.Ensure;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.core.commons.url.UrlEncodingUtils;
 import org.apache.isis.core.metamodel.adapter.version.Version;
 import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
-
-
-/**
- * Defines a subtype of {@link Oid} specific to a root adapter.
- * 
- * <p>
- * The root adapter/pojo can be recreated with no further information; the
- * {@link #getObjectSpecId()} can be used to fetch the corresponding
- * {@link ObjectSpecification} using {@link SpecificationLoaderSpi#lookupBySpecId(ObjectSpecId)}.
- * 
- * <p>
- * <p>
- * As such, is directly akin to the DSP's oid that is of the form 
- * <tt>CUS|1234567A</tt>, where the overall form is a simple string
- * and also identifies the type of the object.
- *
- * <p>
- * In addition, can be directly encoded/decoded into strings.  The {@link #enString(OidMarshaller)} interface
- * is defined in the interface; implementations must also provide a static 
- * <tt>deString(String)</tt> factory method.
- */
-public interface RootOid extends TypedOid {
 
-    String getIdentifier();
-    
-    void setVersion(Version version);
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
+public class RootOid implements Oid, Serializable {
+
+    private final static Logger LOG = LoggerFactory.getLogger(RootOid.class);
+
+    private static final long serialVersionUID = 1L;
+
+    private final ObjectSpecId objectSpecId;
+    private final String identifier;
+    private final State state;
+
+    // not part of equality check
+    private Version version;
+
+    private int cachedHashCode;
+
+
+
+    // ////////////////////////////////////////////
+    // Constructor, factory methods
+    // ////////////////////////////////////////////
+
+    public static RootOid createTransient(final ObjectSpecId objectSpecId, final String identifier) {
+        return new RootOid(objectSpecId, identifier, State.TRANSIENT);
+    }
+
+    public static RootOid create(final Bookmark bookmark) {
+        return new RootOid(ObjectSpecId.of(bookmark.getObjectType()), bookmark.getIdentifier(), State.from(bookmark));
+    }
+
+    public static RootOid create(final ObjectSpecId objectSpecId, final String identifier) {
+        return create(objectSpecId, identifier, null);
+    }
+
+    public static RootOid create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence) {
+        return create(objectSpecId, identifier, versionSequence, null, null);
+    }
+
+    public static RootOid create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence, final String versionUser) {
+        return create(objectSpecId, identifier, versionSequence, versionUser, null);
+    }
+
+    public static RootOid create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence, final Long versionUtcTimestamp) {
+        return create(objectSpecId, identifier, versionSequence, null, versionUtcTimestamp);
+    }
+
+    public static RootOid create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence, final String versionUser, final Long versionUtcTimestamp) {
+        return new RootOid(objectSpecId, identifier, State.PERSISTENT, Version.create(versionSequence,
+                versionUser, versionUtcTimestamp));
+    }
+
+
+
+    public RootOid(final ObjectSpecId objectSpecId, final String identifier, final State state) {
+        this(objectSpecId, identifier, state, (Version)null);
+    }
+
+    public RootOid(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence) {
+        this(objectSpecId, identifier, state, versionSequence, null, null);
+    }
+
+    /**
+     * If specify version sequence, can optionally specify the user that changed the object.  This is used for informational purposes only.
+     */
+    public RootOid(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence, final String versionUser) {
+        this(objectSpecId, identifier, state, versionSequence, versionUser, null);
+    }
+
+    /**
+     * If specify version sequence, can optionally specify utc timestamp that the oid was changed.  This is used for informational purposes only.
+     */
+    public RootOid(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence, final Long versionUtcTimestamp) {
+        this(objectSpecId, identifier, state, versionSequence, null, versionUtcTimestamp);
+    }
+
+    /**
+     * If specify version sequence, can optionally specify user and/or utc timestamp that the oid was changed.  This is used for informational purposes only.
+     */
+    public RootOid(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence, final String versionUser, final Long versionUtcTimestamp) {
+        this(objectSpecId, identifier, state, Version.create(versionSequence, versionUser, versionUtcTimestamp));
+    }
+
+    public RootOid(final ObjectSpecId objectSpecId, final String identifier, final State state, final Version version) {
+        Ensure.ensureThatArg(objectSpecId, is(not(nullValue())));
+        Ensure.ensureThatArg(identifier, is(not(nullValue())));
+        Ensure.ensureThatArg(identifier, is(not(IsisMatchers.contains("#"))), "identifier '" + identifier + "' contains a '#' symbol");
+        Ensure.ensureThatArg(identifier, is(not(IsisMatchers.contains("@"))), "identifier '" + identifier + "' contains an '@' symbol");
+        Ensure.ensureThatArg(state, is(not(nullValue())));
+
+        this.objectSpecId = objectSpecId;
+        this.identifier = identifier;
+        this.state = state;
+        this.version = version;
+        initialized();
+    }
+
+    private void initialized() {
+        cacheState();
+    }
+
+
+    // ////////////////////////////////////////////
+    // Encodeable
+    // ////////////////////////////////////////////
+
+    public RootOid(final DataInputExtended input) throws IOException {
+        final String oidStr = input.readUTF();
+        final RootOid oid = getEncodingMarshaller().unmarshal(oidStr, RootOid.class);
+        this.objectSpecId = oid.objectSpecId;
+        this.identifier = oid.identifier;
+        this.state = oid.state;
+        this.version = oid.version;
+        cacheState();
+    }
+
+    @Override
+    public void encode(final DataOutputExtended output) throws IOException {
+        output.writeUTF(enString(getEncodingMarshaller()));
+    }
+
+
+    /**
+     * Cannot be a reference because Oid gets serialized by wicket viewer
+     */
+    private OidMarshaller getEncodingMarshaller() {
+        return new OidMarshaller();
+    }
+
+
+    // ////////////////////////////////////////////
+    // deString'able, enString
+    // ////////////////////////////////////////////
+
+    public static RootOid deStringEncoded(final String urlEncodedOidStr, final OidMarshaller oidMarshaller) {
+        final String oidStr = UrlEncodingUtils.urlDecode(urlEncodedOidStr);
+        return deString(oidStr, oidMarshaller);
+    }
+
+    public static RootOid deString(final String oidStr, final OidMarshaller oidMarshaller) {
+        return oidMarshaller.unmarshal(oidStr, RootOid.class);
+    }
+
+    @Override
+    public String enString(final OidMarshaller oidMarshaller) {
+        return oidMarshaller.marshal(this);
+    }
+
+    @Override
+    public String enStringNoVersion(final OidMarshaller oidMarshaller) {
+        return oidMarshaller.marshalNoVersion(this);
+    }
+
+    // ////////////////////////////////////////////
+    // Properties
+    // ////////////////////////////////////////////
+
+    public ObjectSpecId getObjectSpecId() {
+        return objectSpecId;
+    }
+
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    @Override
+    public boolean isTransient() {
+        return state.isTransient();
+    }
+
+    @Override
+    public boolean isViewModel() {
+        return state.isViewModel();
+    }
+
+    @Override
+    public boolean isPersistent() {
+        return state.isPersistent();
+    }
+
+
+
+
+    // ////////////////////////////////////////////
+    // Version
+    // ////////////////////////////////////////////
+
+    public Version getVersion() {
+        return version;
+    }
+
+    @Override
+    public void setVersion(final Version version) {
+        this.version = version;
+    }
+
+
+    // ////////////////////////////////////////////
+    // bookmark
+    // ////////////////////////////////////////////
+
+    public Bookmark asBookmark() {
+        final String objectType = state.asBookmarkObjectState().getCode() + getObjectSpecId().asString();
+        final String identifier = getIdentifier();
+        return new Bookmark(objectType, identifier);
+    }
+
+    // ////////////////////////////////////////////
+    // equals, hashCode
+    // ////////////////////////////////////////////
+
+    private void cacheState() {
+        cachedHashCode = 17;
+        cachedHashCode = 37 * cachedHashCode + objectSpecId.hashCode();
+        cachedHashCode = 37 * cachedHashCode + identifier.hashCode();
+        cachedHashCode = 37 * cachedHashCode + (isTransient() ? 0 : 1);
+    }
+
+    @Override
+    public boolean equals(final Object other) {
+        if (other == null) {
+            return false;
+        }
+        if (other == this) {
+            return true;
+        }
+        if (getClass() != other.getClass()) {
+            return false;
+        }
+        return equals((RootOid) other);
+    }
+
+    public boolean equals(final RootOid other) {
+        return Objects.equal(objectSpecId, other.getObjectSpecId()) && Objects.equal(identifier, other.getIdentifier()) && Objects.equal(isTransient(), other.isTransient());
+    }
+
+    @Override
+    public int hashCode() {
+        return cachedHashCode;
+    }
+
+
+    // /////////////////////////////////////////////////////////
+    // toString
+    // /////////////////////////////////////////////////////////
 
-    Bookmark asBookmark();
+    @Override
+    public String toString() {
+        return enString(new OidMarshaller());
+    }
 
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java
deleted file mode 100644
index 0748e03..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefault.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.adapter.oid;
-
-import java.io.IOException;
-import java.io.Serializable;
-import com.google.common.base.Objects;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.core.commons.encoding.DataInputExtended;
-import org.apache.isis.core.commons.encoding.DataOutputExtended;
-import org.apache.isis.core.commons.ensure.Ensure;
-import org.apache.isis.core.commons.matchers.IsisMatchers;
-import org.apache.isis.core.commons.url.UrlEncodingUtils;
-import org.apache.isis.core.metamodel.adapter.version.Version;
-import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-
-public final class RootOidDefault implements Serializable, RootOid {
-
-    private final static Logger LOG = LoggerFactory.getLogger(RootOidDefault.class);
-
-    private static final long serialVersionUID = 1L;
-
-    private final ObjectSpecId objectSpecId;
-    private final String identifier;
-    private final State state;
-    
-    // not part of equality check
-    private Version version;
-
-    private int cachedHashCode;
-
-    
-    
-    // ////////////////////////////////////////////
-    // Constructor, factory methods
-    // ////////////////////////////////////////////
-
-    public static RootOidDefault createTransient(final ObjectSpecId objectSpecId, final String identifier) {
-        return new RootOidDefault(objectSpecId, identifier, State.TRANSIENT);
-    }
-
-    public static RootOid create(final Bookmark bookmark) {
-        return new RootOidDefault(ObjectSpecId.of(bookmark.getObjectType()), bookmark.getIdentifier(), State.from(bookmark));
-    }
-
-    public static RootOidDefault create(final ObjectSpecId objectSpecId, final String identifier) {
-        return create(objectSpecId, identifier, null);
-    }
-
-    public static RootOidDefault create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence) {
-        return create(objectSpecId, identifier, versionSequence, null, null);
-    }
-
-    public static RootOidDefault create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence, final String versionUser) {
-        return create(objectSpecId, identifier, versionSequence, versionUser, null);
-    }
-
-    public static RootOidDefault create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence, final Long versionUtcTimestamp) {
-        return create(objectSpecId, identifier, versionSequence, null, versionUtcTimestamp);
-    }
-
-    public static RootOidDefault create(final ObjectSpecId objectSpecId, final String identifier, final Long versionSequence, final String versionUser, final Long versionUtcTimestamp) {
-        return new RootOidDefault(objectSpecId, identifier, State.PERSISTENT, Version.create(versionSequence, versionUser, versionUtcTimestamp));
-    }
-
-
-    
-    public RootOidDefault(final ObjectSpecId objectSpecId, final String identifier, final State state) {
-    	this(objectSpecId, identifier, state, (Version)null);
-    }
-
-    public RootOidDefault(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence) {
-        this(objectSpecId, identifier, state, versionSequence, null, null);
-    }
-
-    /**
-     * If specify version sequence, can optionally specify the user that changed the object.  This is used for informational purposes only.
-     */
-    public RootOidDefault(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence, final String versionUser) {
-        this(objectSpecId, identifier, state, versionSequence, versionUser, null);
-    }
-
-    /**
-     * If specify version sequence, can optionally specify utc timestamp that the oid was changed.  This is used for informational purposes only.
-     */
-    public RootOidDefault(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence, final Long versionUtcTimestamp) {
-        this(objectSpecId, identifier, state, versionSequence, null, versionUtcTimestamp);
-    }
-    
-    /**
-     * If specify version sequence, can optionally specify user and/or utc timestamp that the oid was changed.  This is used for informational purposes only.
-     */
-    public RootOidDefault(final ObjectSpecId objectSpecId, final String identifier, final State state, final Long versionSequence, final String versionUser, final Long versionUtcTimestamp) {
-        this(objectSpecId, identifier, state, Version.create(versionSequence, versionUser, versionUtcTimestamp));
-    }
-
-    public RootOidDefault(final ObjectSpecId objectSpecId, final String identifier, final State state, final Version version) {
-        Ensure.ensureThatArg(objectSpecId, is(not(nullValue())));
-        Ensure.ensureThatArg(identifier, is(not(nullValue())));
-        Ensure.ensureThatArg(identifier, is(not(IsisMatchers.contains("#"))), "identifier '" + identifier + "' contains a '#' symbol");
-        Ensure.ensureThatArg(identifier, is(not(IsisMatchers.contains("@"))), "identifier '" + identifier + "' contains an '@' symbol");
-        Ensure.ensureThatArg(state, is(not(nullValue())));
-        
-        this.objectSpecId = objectSpecId;
-        this.identifier = identifier;
-        this.state = state;
-        this.version = version;
-        initialized();
-    }
-
-    private void initialized() {
-        cacheState();
-    }
-
-
-    // ////////////////////////////////////////////
-    // Encodeable
-    // ////////////////////////////////////////////
-
-    public RootOidDefault(final DataInputExtended input) throws IOException {
-        final String oidStr = input.readUTF();
-        final RootOidDefault oid = getEncodingMarshaller().unmarshal(oidStr, RootOidDefault.class);
-        this.objectSpecId = oid.objectSpecId;
-        this.identifier = oid.identifier;
-        this.state = oid.state;
-        this.version = oid.version;
-        cacheState();
-    }
-
-    @Override
-    public void encode(final DataOutputExtended output) throws IOException {
-        output.writeUTF(enString(getEncodingMarshaller()));
-    }
-
-
-    /**
-     * Cannot be a reference because Oid gets serialized by wicket viewer
-     */
-    private OidMarshaller getEncodingMarshaller() {
-        return new OidMarshaller();
-    }
-
-
-    // ////////////////////////////////////////////
-    // deString'able, enString
-    // ////////////////////////////////////////////
-
-    public static RootOid deStringEncoded(final String urlEncodedOidStr, final OidMarshaller oidMarshaller) {
-        final String oidStr = UrlEncodingUtils.urlDecode(urlEncodedOidStr);
-        return deString(oidStr, oidMarshaller);
-    }
-
-    public static RootOidDefault deString(final String oidStr, final OidMarshaller oidMarshaller) {
-		return oidMarshaller.unmarshal(oidStr, RootOidDefault.class);
-    }
-
-    @Override
-    public String enString(final OidMarshaller oidMarshaller) {
-        return oidMarshaller.marshal(this);
-    }
-
-    @Override
-    public String enStringNoVersion(final OidMarshaller oidMarshaller) {
-        return oidMarshaller.marshalNoVersion(this);
-    }
-
-    // ////////////////////////////////////////////
-    // Properties
-    // ////////////////////////////////////////////
-
-    @Override
-    public ObjectSpecId getObjectSpecId() {
-        return objectSpecId;
-    }
-
-    public String getIdentifier() {
-        return identifier;
-    }
-
-    @Override
-    public boolean isTransient() {
-        return state.isTransient();
-    }
-
-    @Override
-    public boolean isViewModel() {
-        return state.isViewModel();
-    }
-    
-    @Override
-    public boolean isPersistent() {
-        return state.isPersistent();
-    }
-    
-
-
-
-    // ////////////////////////////////////////////
-    // Version
-    // ////////////////////////////////////////////
-
-	public Version getVersion() {
-		return version;
-	}
-
-    @Override
-    public void setVersion(final Version version) {
-        this.version = version;
-    }
-
-
-    // ////////////////////////////////////////////
-    // bookmark
-    // ////////////////////////////////////////////
-
-    @Override
-    public Bookmark asBookmark() {
-        final String objectType = state.asBookmarkObjectState().getCode() + getObjectSpecId().asString();
-        final String identifier = getIdentifier();
-        return new Bookmark(objectType, identifier);
-    }
-
-    // ////////////////////////////////////////////
-    // equals, hashCode
-    // ////////////////////////////////////////////
-
-    private void cacheState() {
-        cachedHashCode = 17;
-        cachedHashCode = 37 * cachedHashCode + objectSpecId.hashCode();
-        cachedHashCode = 37 * cachedHashCode + identifier.hashCode();
-        cachedHashCode = 37 * cachedHashCode + (isTransient() ? 0 : 1);
-    }
-
-    @Override
-    public boolean equals(final Object other) {
-        if (other == null) {
-            return false;
-        }
-        if (other == this) {
-            return true;
-        }
-        if (getClass() != other.getClass()) {
-            return false;
-        }
-        return equals((RootOid) other);
-    }
-
-    public boolean equals(final RootOid other) {
-        return Objects.equal(objectSpecId, other.getObjectSpecId()) && Objects.equal(identifier, other.getIdentifier()) && Objects.equal(isTransient(), other.isTransient());
-    }
-
-    @Override
-    public int hashCode() {
-        return cachedHashCode;
-    }
-
-    
-    // /////////////////////////////////////////////////////////
-    // toString
-    // /////////////////////////////////////////////////////////
-
-    @Override
-    public String toString() {
-        return enString(new OidMarshaller());
-    }
-
-
-    
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/TypedOid.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/TypedOid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/TypedOid.java
deleted file mode 100644
index 4544cce..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/TypedOid.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.core.metamodel.adapter.oid;
-
-import org.apache.isis.core.metamodel.spec.ObjectSpecId;
-
-
-public interface TypedOid extends Oid {
-    
-    ObjectSpecId getObjectSpecId();
-
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedCollectionFacetDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedCollectionFacetDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedCollectionFacetDefault.java
new file mode 100644
index 0000000..88a6842
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedCollectionFacetDefault.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.parented;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.parented.ParentedCollectionFacet;
+
+public class ParentedCollectionFacetDefault extends MarkerFacetAbstract implements ParentedCollectionFacet {
+
+    public static Class<? extends Facet> type() {
+        return ParentedCollectionFacet.class;
+    }
+
+    public ParentedCollectionFacetDefault(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollection.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollection.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollection.java
deleted file mode 100644
index 385db0f..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollection.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.parented;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.parented.ParentedFacetAbstract;
-
-public class ParentedFacetSinceCollection extends ParentedFacetAbstract {
-
-    public ParentedFacetSinceCollection(final FacetHolder holder) {
-        super(holder);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollectionFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollectionFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollectionFactory.java
index e7032aa..8ff1aa9 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollectionFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/parented/ParentedFacetSinceCollectionFactory.java
@@ -23,14 +23,14 @@ import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
-import org.apache.isis.core.metamodel.facets.object.parented.ParentedFacet;
+import org.apache.isis.core.metamodel.facets.object.parented.ParentedCollectionFacet;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
 import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistry;
 import org.apache.isis.core.metamodel.facets.collections.javautilcollection.CollectionFacetFactory;
 
 /**
  * All {@link CollectionTypeRegistry collection types} are intrinsically
- * {@link ParentedFacet parented}.
+ * {@link ParentedCollectionFacet parented}.
  * 
  * <p> 
  * Must be registered in the {@link ProgrammingModel} after
@@ -47,7 +47,7 @@ public class ParentedFacetSinceCollectionFactory extends FacetFactoryAbstract {
         if (!processClassContaxt.getFacetHolder().containsFacet(CollectionFacet.class)) {
             return;
         }
-        FacetUtil.addFacet(new ParentedFacetSinceCollection(processClassContaxt.getFacetHolder()));
+        FacetUtil.addFacet(new ParentedCollectionFacetDefault(processClassContaxt.getFacetHolder()));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacet.java
new file mode 100644
index 0000000..e8c537a
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacet.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.parented;
+
+import java.util.List;
+import java.util.Set;
+
+import org.apache.isis.core.metamodel.facets.MarkerFacet;
+
+/**
+ * Indicates that this class is parented, that is, wholly contained within a
+ * larger object.
+ * 
+ * <p>
+ * There is (now) only one class of object that is parented, namely internal collections.
+ *
+ * <p>
+ * Internal collections are the {@link List}s, {@link Set}s etc that hold references to
+ * other root entities.
+ */
+public interface ParentedCollectionFacet extends MarkerFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacetAbstract.java
new file mode 100644
index 0000000..249b395
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedCollectionFacetAbstract.java
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.parented;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+
+public abstract class ParentedCollectionFacetAbstract extends MarkerFacetAbstract implements ParentedCollectionFacet {
+
+    public static Class<? extends Facet> type() {
+        return ParentedCollectionFacet.class;
+    }
+
+    public ParentedCollectionFacetAbstract(final FacetHolder holder) {
+        super(type(), holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacet.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacet.java
deleted file mode 100644
index a9e9ab8..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacet.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.parented;
-
-import java.util.List;
-import java.util.Set;
-
-import org.apache.isis.core.metamodel.facets.MarkerFacet;
-import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
-
-/**
- * Indicates that this class is parented, that is, wholly contained within a
- * larger object.
- * 
- * <p>
- * There are two classes of object that are parented:
- * <ul>
- * <li>Aggregated objects</li>
- * <li>Internal collections</li>
- * </ul>
- * 
- * <p>
- * In the standard Apache Isis Programming Model, aggregated objects typically corresponds to
- * applying the <tt>@Aggregated</tt> annotation at the class level.  
- * In terms of an analogy, aggregated is similar to Hibernate's component types
- * (for larger mutable in-line objects) or to Hibernate's user-defined types
- * (for smaller immutable values).
- * 
- * <p>
- * Internal collections are the {@link List}s, {@link Set}s etc that hold references to
- * other root entities.
- * 
- * <p>
- * The object may or may not be {@link ImmutableFacet immutable}.  If an aggregated entity, then it may
- * reference regular entity domain objects or other aggregated objects.
- */
-public interface ParentedFacet extends MarkerFacet {
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacetAbstract.java
deleted file mode 100644
index e43ecc5..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/ParentedFacetAbstract.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.parented;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
-
-public abstract class ParentedFacetAbstract extends MarkerFacetAbstract implements ParentedFacet {
-
-    public static Class<? extends Facet> type() {
-        return ParentedFacet.class;
-    }
-
-    public ParentedFacetAbstract(final FacetHolder holder) {
-        super(type(), holder);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/AggregatedAnnotationFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/AggregatedAnnotationFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/AggregatedAnnotationFactory.java
new file mode 100644
index 0000000..a7b57b8
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/AggregatedAnnotationFactory.java
@@ -0,0 +1,72 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.object.parented.aggregated;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import org.apache.isis.applib.annotation.Aggregated;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facetapi.MetaModelValidatorRefiner;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorAbstract;
+import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
+import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
+
+/**
+ * The {@link Aggregated @Aggregated} annotation is no longer supported; this facet factory prevents its use.
+ */
+public class AggregatedAnnotationFactory extends FacetFactoryAbstract implements
+        MetaModelValidatorRefiner {
+
+    public AggregatedAnnotationFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    final List<String> classesWithAnnotation = Lists.newArrayList();
+
+    @Override
+    public void process(final ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final Aggregated annotation = Annotations.getAnnotation(cls, Aggregated.class);
+        if(annotation != null) {
+            classesWithAnnotation.add(cls.getName());
+        }
+    }
+
+    @Override
+    public void refineMetaModelValidator(
+            final MetaModelValidatorComposite metaModelValidator,
+            final IsisConfiguration configuration) {
+
+        metaModelValidator.add(new MetaModelValidatorAbstract() {
+            @Override
+            public void validate(final ValidationFailures validationFailures) {
+                for (String className : classesWithAnnotation) {
+                    validationFailures.add("%s has @Aggregated annotation, which is no longer supported.",
+                            className);
+                }
+            }
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotation.java
deleted file mode 100644
index faca396..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.parented.aggregated;
-
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.parented.ParentedFacetAbstract;
-
-public class ParentedFacetSinceAggregatedAnnotation extends ParentedFacetAbstract {
-
-    public ParentedFacetSinceAggregatedAnnotation(final FacetHolder holder) {
-        super(holder);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotationFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotationFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotationFactory.java
deleted file mode 100644
index 01e55f0..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/parented/aggregated/ParentedFacetSinceAggregatedAnnotationFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.object.parented.aggregated;
-
-import org.apache.isis.applib.annotation.Aggregated;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetUtil;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MetaModelValidatorRefiner;
-import org.apache.isis.core.metamodel.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.object.parented.ParentedFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorVisiting;
-import org.apache.isis.core.metamodel.specloader.validator.ValidationFailures;
-
-public class ParentedFacetSinceAggregatedAnnotationFactory extends FacetFactoryAbstract implements
-        MetaModelValidatorRefiner {
-
-    public ParentedFacetSinceAggregatedAnnotationFactory() {
-        super(FeatureType.OBJECTS_ONLY);
-    }
-
-    @Override
-    public void process(final ProcessClassContext processClassContext) {
-        final Aggregated annotation = Annotations.getAnnotation(processClassContext.getCls(), Aggregated.class);
-        FacetUtil.addFacet(create(annotation, processClassContext.getFacetHolder()));
-    }
-
-    private ParentedFacet create(final Aggregated annotation, final FacetHolder holder) {
-        return annotation == null ? null : new ParentedFacetSinceAggregatedAnnotation(holder);
-    }
-
-    @Override
-    public void refineMetaModelValidator(
-            final MetaModelValidatorComposite metaModelValidator,
-            final IsisConfiguration configuration) {
-
-        metaModelValidator.add(new MetaModelValidatorVisiting(new MetaModelValidatorVisiting.Visitor() {
-
-            @Override
-            public boolean visit(final ObjectSpecification objectSpec, final ValidationFailures validationFailures) {
-                final ParentedFacet parentedFacet = objectSpec.getFacet(ParentedFacet.class);
-                if(parentedFacet != null && parentedFacet instanceof ParentedFacetSinceAggregatedAnnotation) {
-                    validationFailures.add("%s has @Aggregated annotation, which is no longer supported.",
-                                    objectSpec.getIdentifier().getClassName());
-                }
-                return true;
-            }
-        }));
-    }
-}

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/recreatable/RecreatableObjectFacetDeclarativeAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/recreatable/RecreatableObjectFacetDeclarativeAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/recreatable/RecreatableObjectFacetDeclarativeAbstract.java
index 16bbe25..76d0b60 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/recreatable/RecreatableObjectFacetDeclarativeAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/recreatable/RecreatableObjectFacetDeclarativeAbstract.java
@@ -22,13 +22,14 @@ package org.apache.isis.core.metamodel.facets.object.recreatable;
 import java.util.List;
 import java.util.Set;
 import java.util.UUID;
+
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.memento.MementoService;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
-import org.apache.isis.core.metamodel.adapter.oid.RootOidDefault;
+import org.apache.isis.core.metamodel.adapter.oid.RootOid;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.properties.update.modify.PropertySetterFacet;
@@ -74,7 +75,7 @@ public abstract class RecreatableObjectFacetDeclarativeAbstract extends Recreata
         if(viewModelAdapter == null) {
             final ObjectSpecification objectSpecification = specificationLoader.loadSpecification(viewModelPojo.getClass());
             final ObjectSpecId objectSpecId = objectSpecification.getSpecId();
-            viewModelAdapter = adapterManager.mapRecreatedPojo(new RootOidDefault(objectSpecId, mementoStr, Oid.State.VIEWMODEL), viewModelPojo);
+            viewModelAdapter = adapterManager.mapRecreatedPojo(new RootOid(objectSpecId, mementoStr, Oid.State.VIEWMODEL), viewModelPojo);
         }
 
         final ObjectSpecification spec = viewModelAdapter.getSpecification();
@@ -116,7 +117,7 @@ public abstract class RecreatableObjectFacetDeclarativeAbstract extends Recreata
         if(viewModelAdapter == null) {
             final ObjectSpecification objectSpecification = specificationLoader.loadSpecification(viewModelPojo.getClass());
             final ObjectSpecId objectSpecId = objectSpecification.getSpecId();
-            viewModelAdapter = adapterManager.mapRecreatedPojo(RootOidDefault.create(objectSpecId, UUID.randomUUID().toString()), viewModelPojo);
+            viewModelAdapter = adapterManager.mapRecreatedPojo(RootOid.create(objectSpecId, UUID.randomUUID().toString()), viewModelPojo);
 
             createdTemporaryAdapter = true;
         }

http://git-wip-us.apache.org/repos/asf/isis/blob/c3f880b7/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/annotcfg/ValueFacetAnnotationOrConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/annotcfg/ValueFacetAnnotationOrConfigurationFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/annotcfg/ValueFacetAnnotationOrConfigurationFactory.java
index 8d3dfe4..eab7343 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/annotcfg/ValueFacetAnnotationOrConfigurationFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/object/value/annotcfg/ValueFacetAnnotationOrConfigurationFactory.java
@@ -38,7 +38,7 @@ import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
 import org.apache.isis.core.metamodel.facets.object.icon.IconFacet;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
-import org.apache.isis.core.metamodel.facets.object.parented.ParentedFacet;
+import org.apache.isis.core.metamodel.facets.object.parented.ParentedCollectionFacet;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
 import org.apache.isis.core.metamodel.facets.object.title.TitleFacet;
 import org.apache.isis.core.metamodel.facets.object.value.EqualByContentFacet;
@@ -72,7 +72,7 @@ import org.apache.isis.core.metamodel.runtimecontext.ServicesInjectorAware;
  * <li> {@link EqualByContentFacet} - if specified explicitly in the annotation
  * </ul>
  * <p>
- * Note that {@link ParentedFacet} is <i>not</i> installed.
+ * Note that {@link ParentedCollectionFacet} is <i>not</i> installed.
  */
 public class ValueFacetAnnotationOrConfigurationFactory extends FacetFactoryAbstract implements IsisConfigurationAware, AuthenticationSessionProviderAware, AdapterManagerAware, ServicesInjectorAware {