incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1357438 [3/5] - in /incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo: jdo-applib/ jdo-applib/src/ jdo-applib/src/main/ jdo-applib/src/main/java/ jdo-applib/src/main/resources/ jdo-applib/src/site/ jdo-applib/src/site/apt/ jdo-...
Date Wed, 04 Jul 2012 23:10:35 GMT
Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/pom.xml?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/pom.xml (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/pom.xml Wed Jul  4 23:10:27 2012
@@ -0,0 +1,78 @@
+<?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-incubating-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>metamodel</artifactId>
+		</dependency>
+
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>progmodel</artifactId>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.isis.core</groupId>
+            <artifactId>testsupport</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.isis.progmodels</groupId>
+            <artifactId>dflt</artifactId>
+        </dependency>
+
+		<!-- LOGGING DEPENDENCIES - LOG4J -->
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+		</dependency>
+	</dependencies>
+</project>

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorAnnotationFacetFactory.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,47 @@
+/*
+ *  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.AnnotationBasedFacetFactoryAbstract;
+
+public class JdoDiscriminatorAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public JdoDiscriminatorAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+
+        final Discriminator annotation = 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()));
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacet.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,7 @@
+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> {
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/JdoDiscriminatorFacetDefault.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,12 @@
+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);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/ObjectSpecIdFacetInferredFromJdoDiscriminatorValueAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/discriminator/package-info.java Wed Jul  4 23:10:27 2012
@@ -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

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyAnnotationFacetFactory.java Wed Jul  4 23:10:27 2012
@@ -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.AnnotationBasedFacetFactoryAbstract;
+
+
+public class JdoEmbeddedOnlyAnnotationFacetFactory extends
+        AnnotationBasedFacetFactoryAbstract {
+
+    public JdoEmbeddedOnlyAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processMethodContext) {
+        final EmbeddedOnly annotation = 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;
+    }
+
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacet.java Wed Jul  4 23:10:27 2012
@@ -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 {
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/JdoEmbeddedOnlyFacetAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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, false);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/ParentedFacetDerivedFromJdoEmbeddedOnlyAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/embeddedonly/package-info.java Wed Jul  4 23:10:27 2012
@@ -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

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableAnnotationFacetFactory.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,55 @@
+/*
+ *  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.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.AnnotationBasedFacetFactoryAbstract;
+
+
+public class JdoPersistenceCapableAnnotationFacetFactory extends
+        AnnotationBasedFacetFactoryAbstract {
+
+    public JdoPersistenceCapableAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final PersistenceCapable annotation = getAnnotation(cls, PersistenceCapable.class);
+        if (annotation == null) {
+            return;
+        }
+        String annotationTableAttribute = annotation.table();
+        if (StringUtils.isNullOrEmpty(annotationTableAttribute)) {
+            annotationTableAttribute = cls.getSimpleName();
+        }
+
+        FacetUtil.addFacet(new JdoPersistenceCapableFacetAnnotation(
+                annotationTableAttribute, processClassContext.getFacetHolder()));
+        return;
+    }
+
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacet.java Wed Jul  4 23:10:27 2012
@@ -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.persistencecapable;
+
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+
+/**
+ * Corresponds to annotating the class with the {@link PersistanceCapable} annotation.
+ * <p>
+ * Maps onto the information in {@link Entity} as follows:
+ * <ul>
+ * <li>{@link PersistanceCapable#table()} -> {@link JdoPersistenceCapableFacet#getTable()}</li>
+ * </ul>
+ */
+public interface JdoPersistenceCapableFacet extends Facet {
+
+    String getTable();
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAbstract.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,43 @@
+/*
+ *  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 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 name;
+
+    public JdoPersistenceCapableFacetAbstract(final String name, final FacetHolder holder) {
+        super(JdoPersistenceCapableFacetAbstract.type(), holder, false);
+        this.name = name;
+    }
+
+    public String getTable() {
+        return name;
+    }
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.persistencecapable;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoPersistenceCapableFacetAnnotation extends JdoPersistenceCapableFacetImpl {
+
+    public JdoPersistenceCapableFacetAnnotation(final String name, final FacetHolder holder) {
+        super(name, holder);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/JdoPersistenceCapableFacetImpl.java Wed Jul  4 23:10:27 2012
@@ -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.persistencecapable;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoPersistenceCapableFacetImpl extends JdoPersistenceCapableFacetAbstract {
+
+    public JdoPersistenceCapableFacetImpl(final String name, final FacetHolder holder) {
+        super(name, holder);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/persistencecapable/package-info.java Wed Jul  4 23:10:27 2012
@@ -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

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoNamedQuery.java Wed Jul  4 23:10:27 2012
@@ -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 noSpec;
+
+    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.noSpec = 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 noSpec;
+    }
+
+    @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;
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueriesFacetAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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);
+    }
+
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryAnnotationFacetFactory.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryAnnotationFacetFactory.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,57 @@
+/*
+ *  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.Queries;
+import javax.jdo.annotations.Query;
+
+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.AnnotationBasedFacetFactoryAbstract;
+
+
+public class JdoQueryAnnotationFacetFactory extends
+        AnnotationBasedFacetFactoryAbstract {
+
+    public JdoQueryAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final Queries namedQueriesAnnotation = getAnnotation(cls,
+                Queries.class);
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+        
+        if (namedQueriesAnnotation != null) {
+            FacetUtil.addFacet(new JdoQueriesFacetAnnotation(
+                    namedQueriesAnnotation.value(), facetHolder));
+            return;
+        }
+
+        final Query namedQueryAnnotation = getAnnotation(cls,
+                Query.class);
+        if (namedQueryAnnotation != null) {
+            FacetUtil.addFacet(new JdoQueryFacetAnnotation(
+                    namedQueryAnnotation, facetHolder));
+        }
+    }
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacet.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacet.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacet.java Wed Jul  4 23:10:27 2012
@@ -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.metamodel.facets.object.query;
+
+import java.util.List;
+
+import javax.jdo.annotations.Query;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+
+
+/**
+ * In the standard JDO Model, corresponds to annotating the class with either
+ * {@link javax.jdo.annotations.Query} or
+ * {@link javax.jdo.annotations.Queries}.
+ * <p>
+ * For a {@link javax.jdo.annotations.Query}, returns a singleton list of
+ * {@link JdoNamedQuery}.
+ * For a {@link javax.jdo.annotations.Queries}, returns a list of
+ * {@link JdoNamedQuery}s.
+ * <p>
+ * In both cases, mapping is as follows
+ * <ul>
+ * <li>{@link javax.jdo.annotations.Query#name()} ->
+ * {@link JdoNamedQuery#getName()
+ * getName()} property of JDO Object Store's own
+ * {@link JdoNamedQuery} value object</li>
+ * <li>{@link javax.jdo.annotations.Query#value()} ->
+ * {@link JdoNamedQuery#getQuery()}
+ * property of JDO Object Store's own
+ * {@link JdoNamedQuery} value object</li>
+ * </ul>
+ * 
+ * <p>
+ * Optional attributes of the {@link Query} annotation are not currently mapped.
+ */
+public interface JdoQueryFacet extends Facet {
+
+    /**
+     * Returns an immutable {@link List}.
+     */
+    List<JdoNamedQuery> getNamedQueries();
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAbstract.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAbstract.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAbstract.java Wed Jul  4 23:10:27 2012
@@ -0,0 +1,57 @@
+/*
+ *  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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.jdo.annotations.Query;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+
+
+public class JdoQueryFacetAbstract extends FacetAbstract implements
+        JdoQueryFacet {
+
+    public static Class<? extends Facet> type() {
+        return JdoQueryFacet.class;
+    }
+
+    private final List<JdoNamedQuery> namedQueries = new ArrayList<JdoNamedQuery>();
+
+    public JdoQueryFacetAbstract(final FacetHolder holder) {
+        super(JdoQueryFacetAbstract.type(), holder, false);
+    }
+
+    protected void add(final Query... jdoNamedQueries) {
+        final ObjectSpecification objSpec = (ObjectSpecification) getFacetHolder();
+        for (final Query jdoNamedQuery : jdoNamedQueries) {
+            namedQueries.add(new JdoNamedQuery(jdoNamedQuery, objSpec));
+        }
+    }
+
+    public List<JdoNamedQuery> getNamedQueries() {
+        return Collections.unmodifiableList(namedQueries);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/query/JdoQueryFacetAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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 JdoQueryFacetAnnotation extends JdoQueryFacetAbstract
+        implements JdoQueryFacet {
+
+    public JdoQueryFacetAnnotation(final Query jdoNamedQuery,
+            final FacetHolder holder) {
+        super(holder);
+        add(jdoNamedQuery);
+    }
+
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/DisabledFacetDerivedFromJdoVersionAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/DisabledFacetDerivedFromJdoVersionAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/DisabledFacetDerivedFromJdoVersionAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/DisabledFacetDerivedFromJdoVersionAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.version;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.When;
+import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacetImpl;
+
+
+/**
+ * Derived from being {@link Transient}.
+ */
+public class DisabledFacetDerivedFromJdoVersionAnnotation extends
+        DisabledFacetImpl {
+
+    public DisabledFacetDerivedFromJdoVersionAnnotation(final FacetHolder holder) {
+        super(When.ALWAYS, holder);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionAnnotationFacetFactory.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionAnnotationFacetFactory.java Wed Jul  4 23:10:27 2012
@@ -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.version;
+
+import javax.jdo.annotations.Version;
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
+
+public class JdoVersionAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public JdoVersionAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContext) {
+        final Version annotation = getAnnotation(processClassContext.getCls(), Version.class);
+        if (annotation == null) {
+            return;
+        }
+        final ObjectSpecification objSpec = (ObjectSpecification) processClassContext.getFacetHolder();
+        String propertyId = annotation.column();
+        ObjectAssociation otoa = objSpec.getAssociation(propertyId);
+        if (otoa == null) {
+            throw new RuntimeException("No such property '" + propertyId + "'");
+        }
+
+        FacetUtil.addFacet(new JdoVersionFacetAnnotation(otoa));
+        FacetUtil.addFacet(new DisabledFacetDerivedFromJdoVersionAnnotation(otoa));
+        FacetUtil.addFacet(new OptionalFacetDerivedFromJdoVersionAnnotation(otoa));
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacet.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacet.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacet.java Wed Jul  4 23:10:27 2012
@@ -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.version;
+
+import javax.jdo.annotations.Version;
+
+import org.apache.isis.core.metamodel.facets.MarkerFacet;
+import org.apache.isis.core.metamodel.facets.SingleValueFacet;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+
+/**
+ * Derived from annotating the class with {@link Version}, is installed on the
+ * property identified by the {@link Version#column()} (as per {@link OneToOneAssociation#getId()}.
+ * 
+ * <p>
+ * Multiple column versions are not currently supported.
+ */
+public interface JdoVersionFacet extends MarkerFacet {
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacetAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacetAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/JdoVersionFacetAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.version;
+
+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 JdoVersionFacetAnnotation extends FacetAbstract implements
+        JdoVersionFacet {
+
+    public static Class<? extends Facet> type() {
+        return JdoVersionFacet.class;
+    }
+
+    public JdoVersionFacetAnnotation(final FacetHolder holder) {
+        super(JdoVersionFacetAnnotation.type(), holder, false);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/OptionalFacetDerivedFromJdoVersionAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/OptionalFacetDerivedFromJdoVersionAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/OptionalFacetDerivedFromJdoVersionAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/OptionalFacetDerivedFromJdoVersionAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.version;
+
+import javax.jdo.annotations.Version;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetDefault;
+import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
+
+
+/**
+ * Derived by presence of {@link Version}.
+ * 
+ * <p>
+ * By default mandatory properties are initialized using the
+ * {@link PropertyDefaultFacet} facet. We don't want this, so this facet marks
+ * the property as optional, meaning that the {@link Version} property is left
+ * untouched by Isis.
+ * 
+ * @see OptionalFacetDerivedFromJpaIdAnnotation
+ */
+public class OptionalFacetDerivedFromJdoVersionAnnotation extends
+        MandatoryFacetDefault {
+
+    public OptionalFacetDerivedFromJdoVersionAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+    @Override
+    public boolean isInvertedSemantics() {
+        return true;
+    }
+
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/package-info.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/package-info.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/package-info.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/object/version/package-info.java Wed Jul  4 23:10:27 2012
@@ -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.version;
\ No newline at end of file

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/DisabledFacetDerivedFromJdoPrimaryKeyAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/DisabledFacetDerivedFromJdoPrimaryKeyAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/DisabledFacetDerivedFromJdoPrimaryKeyAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/DisabledFacetDerivedFromJdoPrimaryKeyAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.prop.primarykey;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.When;
+import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacetImpl;
+
+
+/**
+ * Derived from being {@link Transient}.
+ */
+public class DisabledFacetDerivedFromJdoPrimaryKeyAnnotation extends DisabledFacetImpl {
+
+    public DisabledFacetDerivedFromJdoPrimaryKeyAnnotation(final FacetHolder holder) {
+        super(When.ALWAYS, holder);
+    }
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyAnnotationFacetFactory.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyAnnotationFacetFactory.java Wed Jul  4 23:10:27 2012
@@ -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.prop.primarykey;
+
+import javax.jdo.annotations.PrimaryKey;
+
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.FacetedMethod;
+
+
+public class JdoPrimaryKeyAnnotationFacetFactory extends
+        AnnotationBasedFacetFactoryAbstract {
+
+    public JdoPrimaryKeyAnnotationFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(ProcessMethodContext processMethodContext) {
+        final PrimaryKey annotation = getAnnotation(processMethodContext.getMethod(), PrimaryKey.class);
+        if (annotation == null) {
+            return;
+        }
+
+        final FacetedMethod holder = processMethodContext.getFacetHolder();
+        FacetUtil.addFacet(new JdoPrimaryKeyFacetAnnotation(holder));
+        FacetUtil.addFacet(new OptionalFacetDerivedFromJdoPrimaryKeyAnnotation(holder));
+        FacetUtil.addFacet(new DisabledFacetDerivedFromJdoPrimaryKeyAnnotation(holder));
+    }
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacet.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacet.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacet.java Wed Jul  4 23:10:27 2012
@@ -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.prop.primarykey;
+
+import javax.jdo.annotations.PrimaryKey;
+
+import org.apache.isis.core.metamodel.facets.MarkerFacet;
+
+
+/**
+ * Corresponds to the property with the {@link PrimaryKey} annotation.
+ * <p>
+ * The JDO {@link PrimaryKey} annotation is used internally the JDO object store to
+ * create the {@link Oid}.
+ */
+public interface JdoPrimaryKeyFacet extends MarkerFacet {
+
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAbstract.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAbstract.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAbstract.java Wed Jul  4 23:10:27 2012
@@ -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.prop.primarykey;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.MarkerFacetAbstract;
+
+
+public abstract class JdoPrimaryKeyFacetAbstract extends MarkerFacetAbstract implements
+        JdoPrimaryKeyFacet {
+
+    public static Class<? extends Facet> type() {
+        return JdoPrimaryKeyFacet.class;
+    }
+
+    public JdoPrimaryKeyFacetAbstract(final FacetHolder holder) {
+        super(JdoPrimaryKeyFacetAbstract.type(), holder);
+    }
+}

Added: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAnnotation.java?rev=1357438&view=auto
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAnnotation.java (added)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-metamodel/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jdo/metamodel/facets/prop/primarykey/JdoPrimaryKeyFacetAnnotation.java Wed Jul  4 23:10:27 2012
@@ -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.prop.primarykey;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class JdoPrimaryKeyFacetAnnotation extends JdoPrimaryKeyFacetImpl {
+
+    public JdoPrimaryKeyFacetAnnotation(final FacetHolder holder) {
+        super(holder);
+    }
+
+}



Mime
View raw message