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 2012/12/06 17:59:48 UTC

[38/52] [partial] ISIS-188: more reorganizing of artifacts into physical directories.

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java b/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java
new file mode 100644
index 0000000..055f14b
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java
@@ -0,0 +1,59 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.datanucleus.scenarios.scalar;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.Utils;
+import org.apache.isis.runtimes.dflt.testsupport.IsisSystemWithFixtures;
+import org.apache.isis.tck.dom.scalars.AutoAssignedEntity;
+import org.apache.isis.tck.dom.scalars.AutoAssignedEntityRepository;
+
+public class Persistence_persist_dataStoreAssignedPrimaryKey {
+
+    private AutoAssignedEntityRepository repo = new AutoAssignedEntityRepository();
+    
+    @Rule
+    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+        .with(Utils.listenerToDeleteFrom("AUTOASSIGNEDENTITY"))
+        .withServices(repo)
+        .build();
+
+    @Test
+    public void persistTwo() throws Exception {
+        iswf.beginTran();
+        repo.newEntity();
+        repo.newEntity();
+        iswf.commitTran();
+
+        iswf.bounceSystem();
+        
+        iswf.beginTran();
+        List<AutoAssignedEntity> list = repo.list();
+        assertThat(list.size(), is(2));
+        iswf.commitTran();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateConverterTest.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateConverterTest.java b/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateConverterTest.java
new file mode 100644
index 0000000..02bfe24
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateConverterTest.java
@@ -0,0 +1,60 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.datanucleus.valuetypes;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.value.Date;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.valuetypes.IsisDateConverter;
+
+public class IsisDateConverterTest {
+
+    private IsisDateConverter converter;
+
+    @Before
+    public void setUp() throws Exception {
+        converter = new IsisDateConverter();
+    }
+    
+    @Test
+    public void roundTrip() {
+        Date date = new Date();
+        final Long value = converter.toDatastoreType(date);
+        Date date2 = (Date) converter.toMemberType(value);
+        
+        // necessary to use dateValue() because the Isis date (rather poorly) does not
+        // override equals() / hashCode()
+        assertThat(date.dateValue(), is(equalTo(date2.dateValue())));
+    }
+
+    @Test
+    public void toLong_whenNull() {
+        assertNull(converter.toDatastoreType(null));
+    }
+
+    @Test
+    public void toObject_whenNull() {
+        assertNull(converter.toMemberType(null));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateMappingTest.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateMappingTest.java b/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateMappingTest.java
new file mode 100644
index 0000000..40c9d7e
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateMappingTest.java
@@ -0,0 +1,50 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.datanucleus.valuetypes;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.value.Date;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.datanucleus.valuetypes.IsisDateMapping;
+
+public class IsisDateMappingTest {
+
+    private IsisDateMapping dateMapping;
+
+    @Before
+    public void setUp() throws Exception {
+        dateMapping = new IsisDateMapping();
+    }
+    
+    @Test
+    public void roundTrip() {
+        Date date = new Date();
+        final Long datastoreValue = dateMapping.objectToLong(date);
+        Date date2 = (Date) dateMapping.longToObject(datastoreValue);
+        
+        // necessary to use dateValue() because the Isis date (rather poorly) does not
+        // override equals() / hashCode()
+        assertThat(date.dateValue(), is(equalTo(date2.dateValue())));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/NOTICE
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/NOTICE b/framework/component/objectstore/jdo/jdo-metamodel/NOTICE
new file mode 100644
index 0000000..d391f54
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/NOTICE
@@ -0,0 +1,7 @@
+Apache Isis
+Copyright 2010-2011 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/pom.xml b/framework/component/objectstore/jdo/jdo-metamodel/pom.xml
new file mode 100644
index 0000000..b7a365c
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.isis.runtimes.dflt.objectstores</groupId>
+		<artifactId>jdo</artifactId>
+		<version>0.3.1-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>jdo-metamodel</artifactId>
+	<name>JDO ObjectStore MetaModel Support</name>
+
+    <properties>
+	    <siteBaseDir>..</siteBaseDir>
+	    <relativeUrl>jdo-metamodel/</relativeUrl>
+	</properties>
+
+    <!-- used in Site generation for relative references. -->
+    <url>http://incubator.apache.org/isis/${relativeUrl}</url>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.isis.runtimes.dflt.objectstores</groupId>
+			<artifactId>jdo-applib</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.isis.core</groupId>
+			<artifactId>isis-metamodel</artifactId>
+		</dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-metamodel</artifactId>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>isis-unittestsupport</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+		<!-- LOGGING DEPENDENCIES - LOG4J -->
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableAnnotationFacetFactory.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableAnnotationFacetFactory.java
new file mode 100644
index 0000000..4cc2912
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableAnnotationFacetFactory.java
@@ -0,0 +1,48 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.applib.annotations.Auditable;
+
+
+public class AuditableAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public AuditableAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final Auditable annotation = Annotations.getAnnotation(cls, Auditable.class);
+        if (annotation == null) {
+            return;
+        }
+        FacetUtil.addFacet(new AuditableFacetAnnotation(
+                processClassContext.getFacetHolder()));
+        return;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacet.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacet.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacet.java
new file mode 100644
index 0000000..5e75f9c
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacet.java
@@ -0,0 +1,31 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.runtimes.dflt.objectstores.jdo.applib.annotations.Auditable;
+
+
+/**
+ * Corresponds to annotating the class with the {@link Auditable} annotation.
+ */
+public interface AuditableFacet extends Facet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAbstract.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAbstract.java
new file mode 100644
index 0000000..e67cc50
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAbstract.java
@@ -0,0 +1,39 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public abstract class AuditableFacetAbstract extends FacetAbstract implements
+        AuditableFacet {
+
+
+    public static Class<? extends Facet> type() {
+        return AuditableFacet.class;
+    }
+
+    public AuditableFacetAbstract(FacetHolder facetHolder) {
+        super(AuditableFacetAbstract.type(), facetHolder, Derivation.NOT_DERIVED);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotation.java
new file mode 100644
index 0000000..4ff066d
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class AuditableFacetAnnotation extends AuditableFacetImpl {
+
+    public AuditableFacetAnnotation(FacetHolder facetHolder) {
+        super(facetHolder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetImpl.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetImpl.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetImpl.java
new file mode 100644
index 0000000..a0879fd
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetImpl.java
@@ -0,0 +1,30 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class AuditableFacetImpl extends AuditableFacetAbstract {
+
+    public AuditableFacetImpl(FacetHolder facetHolder) {
+        super(facetHolder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterface.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterface.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterface.java
new file mode 100644
index 0000000..3f71fc6
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterface.java
@@ -0,0 +1,31 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class AuditableFacetMarkerInterface extends AuditableFacetImpl {
+
+    public AuditableFacetMarkerInterface(FacetHolder facetHolder) {
+        super(facetHolder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceFacetFactory.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceFacetFactory.java
new file mode 100644
index 0000000..664b97e
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceFacetFactory.java
@@ -0,0 +1,45 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.auditable;
+
+
+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.runtimes.dflt.objectstores.jdo.applib.Auditable;
+
+
+public class AuditableMarkerInterfaceFacetFactory extends FacetFactoryAbstract {
+
+    public AuditableMarkerInterfaceFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        if(!Auditable.class.isAssignableFrom(cls)) {
+            return;
+        }
+        FacetUtil.addFacet(new AuditableFacetMarkerInterface(
+                processClassContext.getFacetHolder()));
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityAnnotationFacetFactory.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityAnnotationFacetFactory.java
new file mode 100644
index 0000000..335fee6
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityAnnotationFacetFactory.java
@@ -0,0 +1,52 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.datastoreidentity;
+
+
+import javax.jdo.annotations.DatastoreIdentity;
+import javax.jdo.annotations.IdGeneratorStrategy;
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+
+
+public class JdoDatastoreIdentityAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public JdoDatastoreIdentityAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final DatastoreIdentity annotation = Annotations.getAnnotation(cls, DatastoreIdentity.class);
+        if (annotation == null) {
+            return;
+        }
+        IdGeneratorStrategy strategyAttribute = annotation.strategy();
+        
+        FacetUtil.addFacet(new JdoDatastoreIdentityFacetAnnotation(
+                strategyAttribute, processClassContext.getFacetHolder()));
+        return;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacet.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacet.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacet.java
new file mode 100644
index 0000000..0fca9ed
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacet.java
@@ -0,0 +1,34 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.datastoreidentity;
+
+
+import javax.jdo.annotations.DatastoreIdentity;
+import javax.jdo.annotations.IdGeneratorStrategy;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+
+/**
+ * Corresponds to annotating the class with the {@link DatastoreIdentity} annotation.
+ */
+public interface JdoDatastoreIdentityFacet extends Facet {
+
+    IdGeneratorStrategy getStrategy();
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAbstract.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAbstract.java
new file mode 100644
index 0000000..bee946d
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAbstract.java
@@ -0,0 +1,46 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.datastoreidentity;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public abstract class JdoDatastoreIdentityFacetAbstract extends FacetAbstract implements
+        JdoDatastoreIdentityFacet {
+
+
+    public static Class<? extends Facet> type() {
+        return JdoDatastoreIdentityFacet.class;
+    }
+
+    private final IdGeneratorStrategy strategy;
+
+    public JdoDatastoreIdentityFacetAbstract(IdGeneratorStrategy strategy, FacetHolder facetHolder) {
+        super(JdoDatastoreIdentityFacetAbstract.type(), facetHolder, Derivation.NOT_DERIVED);
+        this.strategy = strategy;
+    }
+
+    public IdGeneratorStrategy getStrategy() {
+        return strategy;
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAnnotation.java
new file mode 100644
index 0000000..7a03135
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAnnotation.java
@@ -0,0 +1,32 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.datastoreidentity;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoDatastoreIdentityFacetAnnotation extends JdoDatastoreIdentityFacetImpl {
+
+    public JdoDatastoreIdentityFacetAnnotation(IdGeneratorStrategy strategy, FacetHolder facetHolder) {
+        super(strategy, facetHolder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetImpl.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetImpl.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetImpl.java
new file mode 100644
index 0000000..062b4cc
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetImpl.java
@@ -0,0 +1,33 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.datastoreidentity;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoDatastoreIdentityFacetImpl extends JdoDatastoreIdentityFacetAbstract {
+
+    public JdoDatastoreIdentityFacetImpl(IdGeneratorStrategy strategy, FacetHolder facetHolder) {
+        super(strategy, facetHolder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/package-info.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/package-info.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/package-info.java
new file mode 100644
index 0000000..bd09b9b
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/package-info.java
@@ -0,0 +1,17 @@
+/**
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.datastoreidentity;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java
new file mode 100644
index 0000000..dd1640c
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java
@@ -0,0 +1,48 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.discriminator;
+
+import javax.jdo.annotations.Discriminator;
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+
+public class JdoDiscriminatorAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public JdoDiscriminatorAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+
+        final Discriminator annotation = Annotations.getAnnotation(processClassContext.getCls(), Discriminator.class);
+        if (annotation == null) {
+            return;
+        }
+        final String annotationValueAttribute = annotation.value();
+
+        FacetUtil.addFacet(new ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation(annotationValueAttribute, processClassContext.getFacetHolder()));
+        FacetUtil.addFacet(new JdoDiscriminatorFacetDefault(annotationValueAttribute, processClassContext.getFacetHolder()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java
new file mode 100644
index 0000000..6c19f60
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java
@@ -0,0 +1,25 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.discriminator;
+
+import org.apache.isis.core.metamodel.facets.SingleValueFacet;
+
+public interface JdoDiscriminatorFacet extends SingleValueFacet<String> {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java
new file mode 100644
index 0000000..491148d
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java
@@ -0,0 +1,30 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.discriminator;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleValueFacetAbstract;
+
+public class JdoDiscriminatorFacetDefault extends SingleValueFacetAbstract<String> implements JdoDiscriminatorFacet {
+
+    public JdoDiscriminatorFacetDefault(String value, FacetHolder holder) {
+        super(JdoDiscriminatorFacet.class, value, holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java
new file mode 100644
index 0000000..2bedb82
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java
@@ -0,0 +1,35 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.discriminator;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.object.objecttype.ObjectSpecIdFacetAbstract;
+
+
+public class ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation extends
+        ObjectSpecIdFacetAbstract {
+
+    public ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation(final String value,
+            final FacetHolder holder) {
+        super(value, holder);
+    }
+
+}
+
+// Copyright (c) Naked Objects Group Ltd.

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java
new file mode 100644
index 0000000..6bf2f4a
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java
@@ -0,0 +1,22 @@
+/**
+ *  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.
+ */
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.isis.runtimes.dflt.objectstores.jdo.metamodel.facets.object.discriminator;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java
new file mode 100644
index 0000000..48d35e3
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java
@@ -0,0 +1,53 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.embeddedonly;
+
+import javax.jdo.annotations.EmbeddedOnly;
+
+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.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+
+
+public class JdoEmbeddedOnlyAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public JdoEmbeddedOnlyAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processMethodContext) {
+        final EmbeddedOnly annotation = Annotations.getAnnotation(processMethodContext.getCls(), EmbeddedOnly.class);
+        if (annotation == null) {
+            return;
+        }
+
+        final FacetHolder facetHolder = processMethodContext.getFacetHolder();
+        FacetUtil
+                .addFacet(new ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation(
+                        facetHolder));
+        FacetUtil.addFacet(new JdoEmbeddedOnlyFacetAnnotation(facetHolder));
+
+        return;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java
new file mode 100644
index 0000000..3489594
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java
@@ -0,0 +1,32 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.embeddedonly;
+
+import org.apache.isis.core.metamodel.facets.MarkerFacet;
+
+/**
+ * Corresponds to annotating the class with {@link Embeddable}.
+ * <p>
+ * The JPA {@link Embeddable} annotation has no attributes. However, in addition
+ * to this facet it does also implicitly map to
+ * {@link ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation}.
+ */
+public interface JdoEmbeddedOnlyFacet extends MarkerFacet {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java
new file mode 100644
index 0000000..0547427
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.embeddedonly;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoEmbeddedOnlyFacetAnnotation extends FacetAbstract implements
+        JdoEmbeddedOnlyFacet {
+
+    public static Class<? extends Facet> type() {
+        return JdoEmbeddedOnlyFacet.class;
+    }
+
+    public JdoEmbeddedOnlyFacetAnnotation(final FacetHolder holder) {
+        super(JdoEmbeddedOnlyFacetAnnotation.type(), holder, Derivation.NOT_DERIVED);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java
new file mode 100644
index 0000000..5abcb16
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.embeddedonly;
+
+import javax.jdo.annotations.EmbeddedOnly;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.aggregated.ParentedFacetAbstract;
+
+/**
+ * Derived from being {@link EmbeddedOnly}.
+ */
+public class ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation extends
+        ParentedFacetAbstract {
+
+    public ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation(
+            final FacetHolder holder) {
+        super(holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java
new file mode 100644
index 0000000..8a1277b
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java
@@ -0,0 +1,22 @@
+/**
+ *  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.
+ */
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.isis.runtimes.dflt.objectstores.jdo.metamodel.facets.object.embeddedonly;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java
new file mode 100644
index 0000000..264f302
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java
@@ -0,0 +1,58 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.persistencecapable;
+
+
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+
+import org.apache.isis.core.commons.lang.StringUtils;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+
+
+public class JdoPersistenceCapableAnnotationFacetFactory extends FacetFactoryAbstract {
+
+    public JdoPersistenceCapableAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final PersistenceCapable annotation = Annotations.getAnnotation(cls, PersistenceCapable.class);
+        if (annotation == null) {
+            return;
+        }
+        String annotationTableAttribute = annotation.table();
+        if (StringUtils.isNullOrEmpty(annotationTableAttribute)) {
+            annotationTableAttribute = cls.getSimpleName();
+        }
+
+        final IdentityType annotationIdentityType = annotation.identityType();
+        
+        FacetUtil.addFacet(new JdoPersistenceCapableFacetAnnotation(
+                annotationTableAttribute, annotationIdentityType, processClassContext.getFacetHolder()));
+        return;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java
new file mode 100644
index 0000000..d3b0e5f
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.persistencecapable;
+
+
+import javax.jdo.annotations.IdentityType;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+
+/**
+ * Corresponds to annotating the class with the {@link PersistenceCapable} annotation.
+ */
+public interface JdoPersistenceCapableFacet extends Facet {
+
+    IdentityType getIdentityType();
+    
+    String getTable();
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java
new file mode 100644
index 0000000..cf9d637
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java
@@ -0,0 +1,51 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.persistencecapable;
+
+import javax.jdo.annotations.IdentityType;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public abstract class JdoPersistenceCapableFacetAbstract extends FacetAbstract implements
+        JdoPersistenceCapableFacet {
+
+    public static Class<? extends Facet> type() {
+        return JdoPersistenceCapableFacet.class;
+    }
+
+    private final String table;
+    private final IdentityType identityType;
+
+    public JdoPersistenceCapableFacetAbstract(final String table, IdentityType identityType, final FacetHolder holder) {
+        super(JdoPersistenceCapableFacetAbstract.type(), holder, Derivation.NOT_DERIVED);
+        this.table = table;
+        this.identityType = identityType;
+    }
+
+    public IdentityType getIdentityType() {
+        return identityType;
+    }
+    
+    public String getTable() {
+        return table;
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java
new file mode 100644
index 0000000..0811e23
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java
@@ -0,0 +1,32 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.persistencecapable;
+
+import javax.jdo.annotations.IdentityType;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoPersistenceCapableFacetAnnotation extends JdoPersistenceCapableFacetImpl {
+
+    public JdoPersistenceCapableFacetAnnotation(final String name, IdentityType identityType, final FacetHolder holder) {
+        super(name, identityType, holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java
new file mode 100644
index 0000000..c988528
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java
@@ -0,0 +1,32 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.persistencecapable;
+
+import javax.jdo.annotations.IdentityType;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoPersistenceCapableFacetImpl extends JdoPersistenceCapableFacetAbstract {
+
+    public JdoPersistenceCapableFacetImpl(final String table, IdentityType identityType, final FacetHolder holder) {
+        super(table, identityType, holder);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java
new file mode 100644
index 0000000..680bf35
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java
@@ -0,0 +1,22 @@
+/**
+ *  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.
+ */
+/**
+ * 
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.isis.runtimes.dflt.objectstores.jdo.metamodel.facets.object.persistencecapable;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java
new file mode 100644
index 0000000..23919cd
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java
@@ -0,0 +1,100 @@
+/*
+ *  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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.query;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
+import javax.jdo.annotations.Query;
+
+import org.apache.isis.core.commons.ensure.Ensure;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+
+/**
+ * Value object that represents the information of a
+ * {@link javax.jdo.annotations.Query}.
+ * 
+ * @see {@link JdoQueryFacet}.
+ */
+public final class JdoNamedQuery {
+
+    private final String name;
+    private final String query;
+    private final ObjectSpecification objSpec;
+
+    public JdoNamedQuery(final String name, final String query,
+            final ObjectSpecification noSpec) {
+        Ensure.ensureThatArg(name, is(not(nullValue())));
+        Ensure.ensureThatArg(query, is(not(nullValue())));
+        Ensure.ensureThatArg(noSpec, is(not(nullValue())));
+
+        this.name = name;
+        this.query = query;
+        this.objSpec = noSpec;
+    }
+
+    public JdoNamedQuery(final Query jdoNamedQuery,
+            final ObjectSpecification objSpec) {
+        this(jdoNamedQuery.name(), jdoNamedQuery.value(), objSpec);
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getQuery() {
+        return query;
+    }
+
+    public ObjectSpecification getObjectSpecification() {
+        return objSpec;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final JdoNamedQuery other = (JdoNamedQuery) obj;
+        if (name == null) {
+            if (other.name != null) {
+                return false;
+            }
+        } else if (!name.equals(other.name)) {
+            return false;
+        }
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0861ed93/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java
new file mode 100644
index 0000000..5ae56e7
--- /dev/null
+++ b/framework/component/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.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.runtimes.dflt.objectstores.jdo.metamodel.facets.object.query;
+
+import javax.jdo.annotations.Query;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoQueriesFacetAnnotation extends JdoQueryFacetAbstract
+        implements JdoQueryFacet {
+
+    public JdoQueriesFacetAnnotation(final Query[] jdoNamedQueries,
+            final FacetHolder holder) {
+        super(holder);
+        add(jdoNamedQueries);
+    }
+
+
+}