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 12:09:56 UTC
[17/51] [partial] ISIS-188: moving components into correct
directories.
http://git-wip-us.apache.org/repos/asf/isis/blob/cd9f2e4a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_jdkValuedEntity.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_jdkValuedEntity.java b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_jdkValuedEntity.java
new file mode 100644
index 0000000..52698f4
--- /dev/null
+++ b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_jdkValuedEntity.java
@@ -0,0 +1,117 @@
+/*
+ * 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.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Timestamp;
+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.JdkValuedEntity;
+import org.apache.isis.tck.dom.scalars.JdkValuedEntityRepository;
+import org.apache.isis.tck.dom.scalars.MyEnum;
+
+public class Persistence_persistAndUpdate_jdkValuedEntity {
+
+ private JdkValuedEntityRepository repo = new JdkValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("JDKVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void persistTwo() throws Exception {
+ iswf.beginTran();
+ repo.newEntity().setStringProperty("1");
+ repo.newEntity().setStringProperty("2");
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ List<JdkValuedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+ @Test
+ public void persist_then_update() throws Exception {
+ iswf.beginTran();
+ JdkValuedEntity entity = repo.newEntity();
+ entity.setStringProperty("1");
+ entity.setBigDecimalProperty(BigDecimal.valueOf(543210987654321L, 0)); // mssqlserver can cope with scale>0, but hsqldb cannot
+ entity.setBigIntegerProperty(BigInteger.valueOf(123456789012345L));
+ entity.setJavaSqlDateProperty(new java.sql.Date(Utils.toMillis(2009, 6, 11)));
+ entity.setJavaSqlTimeProperty(new java.sql.Time(Utils.toMillis(1970, 1, 1, 0, 5, 10))); // date portion is unimportant, is preserved on mssqlserver but not on hsqldb
+ entity.setJavaSqlTimestampProperty(new Timestamp(Utils.toMillis(2010, 5, 13, 20, 25, 30)));
+ entity.setJavaUtilDateProperty(new java.util.Date(Utils.toMillis(2010, 5, 13, 22, 17, 12)));
+ entity.setMyEnum(MyEnum.GREEN);
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+
+ assertThat(entity.getStringProperty(), is("1"));
+ assertThat(entity.getBigDecimalProperty(), is(BigDecimal.valueOf(543210987654321L, 0)));
+ assertThat(entity.getBigIntegerProperty(), is(BigInteger.valueOf(123456789012345L)));
+ assertThat(entity.getJavaSqlDateProperty(), is(new java.sql.Date(Utils.toMillis(2009, 6, 11))));
+ assertThat(entity.getJavaSqlTimeProperty(), is(new java.sql.Time(Utils.toMillis(1970, 1, 1, 0, 5, 10))));
+ assertThat(entity.getJavaSqlTimestampProperty(), is(new Timestamp(Utils.toMillis(2010, 5, 13, 20, 25, 30))));
+ assertThat(entity.getJavaUtilDateProperty(), is(new java.util.Date(Utils.toMillis(2010, 5, 13, 22, 17, 12))));
+ assertThat(entity.getMyEnum(), is(MyEnum.GREEN));
+
+
+ entity.setBigDecimalProperty(BigDecimal.valueOf(123456789012345L, 0));
+ entity.setBigIntegerProperty(BigInteger.valueOf(543210987654321L));
+ entity.setJavaSqlDateProperty(new java.sql.Date(Utils.toMillis(2010, 5, 13)));
+ entity.setJavaSqlTimeProperty(new java.sql.Time(Utils.toMillis(1970, 1, 1, 5, 10, 15)));
+ entity.setJavaSqlTimestampProperty(new Timestamp(Utils.toMillis(2010, 5, 13, 10, 15, 20)));
+ entity.setJavaUtilDateProperty(new java.util.Date(Utils.toMillis(2010, 5, 13, 20, 15, 10)));
+ entity.setMyEnum(MyEnum.BLUE);
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+ assertThat(entity.getBigDecimalProperty(), is(BigDecimal.valueOf(123456789012345L, 0)));
+ assertThat(entity.getBigIntegerProperty(), is(BigInteger.valueOf(543210987654321L)));
+ assertThat(entity.getJavaSqlDateProperty(), is(new java.sql.Date(Utils.toMillis(2010, 5, 13))));
+ assertThat(entity.getJavaSqlTimeProperty(), is(new java.sql.Time(Utils.toMillis(1970, 1, 1, 5, 10, 15))));
+ assertThat(entity.getJavaSqlTimestampProperty(), is(new Timestamp(Utils.toMillis(2010, 5, 13, 10, 15, 20))));
+ assertThat(entity.getJavaUtilDateProperty(), is(new java.util.Date(Utils.toMillis(2010, 5, 13, 20, 15, 10))));
+ assertThat(entity.getMyEnum(), is(MyEnum.BLUE));
+
+ iswf.commitTran();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/cd9f2e4a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_objectAdapters.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_objectAdapters.java b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_objectAdapters.java
new file mode 100644
index 0000000..f696f9e
--- /dev/null
+++ b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_objectAdapters.java
@@ -0,0 +1,113 @@
+/*
+ * 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.*;
+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.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+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.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_persistAndUpdate_objectAdapters {
+
+ private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void transient_then_persistent() throws Exception {
+
+ iswf.beginTran();
+ PrimitiveValuedEntity entity = repo.newEntity();
+ ObjectAdapter adapter = iswf.adapterFor(entity);
+
+ assertThat(adapter.isTransient(), is(true));
+ assertThat(adapter.getResolveState(), is(ResolveState.TRANSIENT));
+ assertThat(adapter.getOid().isTransient(), is(true));
+
+ entity.setId(1);
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ final List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(1));
+
+ adapter = iswf.adapterFor(list.get(0));
+ assertThat(adapter.getResolveState(), is(ResolveState.RESOLVED));
+ assertThat(adapter.isTransient(), is(false));
+ assertThat(adapter.getOid().enString(new OidMarshaller()), is("PRMV:i~1"));
+
+ iswf.commitTran();
+ }
+
+ @Test
+ public void updated_and_retrieved() throws Exception {
+
+ // given persisted
+ iswf.beginTran();
+ PrimitiveValuedEntity entity = repo.newEntity();
+ ObjectAdapter adapter = iswf.adapterFor(entity);
+
+ entity.setId(1);
+ entity.setCharProperty('X');
+
+ iswf.commitTran();
+
+ // when update
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+ entity.setCharProperty('Y');
+ iswf.commitTran();
+
+ // then adapter's state is resolved
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+ assertThat(entity.getCharProperty(), is('Y'));
+
+ adapter = iswf.adapterFor(entity);
+ assertThat(adapter.getResolveState(), is(ResolveState.RESOLVED));
+
+ iswf.commitTran();
+
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/cd9f2e4a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_primitiveValuedEntity.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_primitiveValuedEntity.java b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_primitiveValuedEntity.java
new file mode 100644
index 0000000..8f87ddd
--- /dev/null
+++ b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_primitiveValuedEntity.java
@@ -0,0 +1,119 @@
+/*
+ * 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.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+
+public class Persistence_persistAndUpdate_primitiveValuedEntity {
+
+ private PrimitiveValuedEntityRepository repo = new PrimitiveValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("PRIMITIVEVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void persistTwo() throws Exception {
+ iswf.beginTran();
+ repo.newEntity().setId(1);
+ repo.newEntity().setId(2);
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ List<PrimitiveValuedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+ @Test
+ public void persist_then_update() throws Exception {
+
+ iswf.beginTran();
+ PrimitiveValuedEntity entity = repo.newEntity();
+ entity.setId(1);
+
+ entity.setBooleanProperty(false);
+ entity.setByteProperty((byte)456);
+ entity.setDoubleProperty(123456789876.0);
+ entity.setFloatProperty(654321.0f);
+ entity.setIntProperty(765);
+ entity.setLongProperty(7654321012345L);
+ entity.setShortProperty((short)543);
+ entity.setCharProperty('A');
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+
+ assertThat(entity.getBooleanProperty(), is(false));
+ assertThat(entity.getByteProperty(), is((byte)456));
+ assertThat(entity.getDoubleProperty(), is(123456789876.0));
+ assertThat(entity.getFloatProperty(), is(654321.0f));
+ assertThat(entity.getIntProperty(), is(765));
+ assertThat(entity.getLongProperty(), is(7654321012345L));
+ assertThat(entity.getShortProperty(), is((short)543));
+ assertThat(entity.getCharProperty(), is('A'));
+
+
+ entity.setBooleanProperty(true);
+ entity.setByteProperty((byte)123);
+ entity.setDoubleProperty(9876543210987.0);
+ entity.setFloatProperty(123456.0f);
+ entity.setIntProperty(456);
+ entity.setLongProperty(12345678901L);
+ entity.setShortProperty((short)4567);
+ entity.setCharProperty('X');
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+
+ assertThat(entity.getBooleanProperty(), is(true));
+ assertThat(entity.getByteProperty(), is((byte)123));
+ assertThat(entity.getDoubleProperty(), is(9876543210987.0));
+ assertThat(entity.getFloatProperty(), is(123456.0f));
+ assertThat(entity.getIntProperty(), is(456));
+ assertThat(entity.getLongProperty(), is(12345678901L));
+ assertThat(entity.getShortProperty(), is((short)4567));
+ assertThat(entity.getCharProperty(), is('X'));
+
+ iswf.commitTran();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/cd9f2e4a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_wrapperValuedEntity.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_wrapperValuedEntity.java b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_wrapperValuedEntity.java
new file mode 100644
index 0000000..50785f0
--- /dev/null
+++ b/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persistAndUpdate_wrapperValuedEntity.java
@@ -0,0 +1,122 @@
+/*
+ * 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.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ResolveState;
+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.PrimitiveValuedEntity;
+import org.apache.isis.tck.dom.scalars.PrimitiveValuedEntityRepository;
+import org.apache.isis.tck.dom.scalars.WrapperValuedEntity;
+import org.apache.isis.tck.dom.scalars.WrapperValuedEntityRepository;
+
+public class Persistence_persistAndUpdate_wrapperValuedEntity {
+
+ private WrapperValuedEntityRepository repo = new WrapperValuedEntityRepository();
+
+ @Rule
+ public IsisSystemWithFixtures iswf = Utils.systemBuilder()
+ .with(Utils.listenerToDeleteFrom("WRAPPERVALUEDENTITY"))
+ .withServices(repo)
+ .build();
+
+ @Test
+ public void persistTwo() throws Exception {
+ iswf.beginTran();
+ repo.newEntity().setStringProperty("1");
+ repo.newEntity().setStringProperty("2");
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ List<WrapperValuedEntity> list = repo.list();
+ assertThat(list.size(), is(2));
+ iswf.commitTran();
+ }
+
+
+ @Test
+ public void persist_then_update() throws Exception {
+ iswf.beginTran();
+ WrapperValuedEntity entity = repo.newEntity();
+ entity.setStringProperty("1");
+ entity.setBooleanProperty(false);
+ entity.setByteProperty((byte)321);
+ entity.setDoubleProperty(123456768723429.0);
+ entity.setFloatProperty(654321.0f);
+ entity.setIntegerProperty(543);
+ entity.setLongProperty(90876512345L);
+ entity.setShortProperty((short)7654);
+ entity.setCharacterProperty('A');
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+ assertThat(entity.getStringProperty(), is("1"));
+ assertThat(entity.getBooleanProperty(), is(false));
+ assertThat(entity.getByteProperty(), is((byte)321));
+ assertThat(entity.getDoubleProperty(), is(123456768723429.0));
+ assertThat(entity.getFloatProperty(), is(654321.0f));
+ assertThat(entity.getIntegerProperty(), is(543));
+ assertThat(entity.getLongProperty(), is(90876512345L));
+ assertThat(entity.getShortProperty(), is((short)7654));
+ assertThat(entity.getCharacterProperty(), is('A'));
+
+
+ entity.setBooleanProperty(true);
+ entity.setByteProperty((byte)123);
+ entity.setDoubleProperty(9876543210987.0);
+ entity.setFloatProperty(123456.0f);
+ entity.setIntegerProperty(456);
+ entity.setLongProperty(12345678901L);
+ entity.setShortProperty((short)4567);
+ entity.setCharacterProperty('X');
+
+ iswf.commitTran();
+
+ iswf.bounceSystem();
+
+ iswf.beginTran();
+ entity = repo.list().get(0);
+ assertThat(entity.getBooleanProperty(), is(true));
+ assertThat(entity.getByteProperty(), is((byte)123));
+ assertThat(entity.getDoubleProperty(), is(9876543210987.0));
+ assertThat(entity.getFloatProperty(), is(123456.0f));
+ assertThat(entity.getIntegerProperty(), is(456));
+ assertThat(entity.getLongProperty(), is(12345678901L));
+ assertThat(entity.getShortProperty(), is((short)4567));
+ assertThat(entity.getCharacterProperty(), is('X'));
+
+ iswf.commitTran();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/cd9f2e4a/framework/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/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/scenarios/scalar/Persistence_persist_dataStoreAssignedPrimaryKey.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateConverterTest.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateConverterTest.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateMappingTest.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-datanucleus/src/test/java/org/apache/isis/runtimes/dflt/objectstores/jdo/datanucleus/valuetypes/IsisDateMappingTest.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/NOTICE
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/NOTICE b/framework/objectstore/jdo/jdo-metamodel/NOTICE
new file mode 100644
index 0000000..d391f54
--- /dev/null
+++ b/framework/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/pom.xml b/framework/objectstore/jdo/jdo-metamodel/pom.xml
new file mode 100644
index 0000000..ea44b2b
--- /dev/null
+++ b/framework/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>runtimes/dflt/objectstores/jdo/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableAnnotationFacetFactory.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacet.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacet.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAbstract.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetAnnotation.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetImpl.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetImpl.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterface.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableFacetMarkerInterface.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/auditable/AuditableMarkerInterfaceFacetFactory.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityAnnotationFacetFactory.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacet.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacet.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAbstract.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAbstract.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetAnnotation.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetImpl.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/JdoDatastoreIdentityFacetImpl.java b/framework/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/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/cd9f2e4a/framework/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/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/datastoreidentity/package-info.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java b/framework/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/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/cd9f2e4a/framework/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/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java b/framework/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/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/cd9f2e4a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java
----------------------------------------------------------------------
diff --git a/framework/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java b/framework/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/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/cd9f2e4a/framework/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/objectstore/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java b/framework/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/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