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 2020/12/03 10:29:22 UTC

[isis] branch master updated (54be779 -> 13326ec)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 54be779  Merge pull request #297 from apache/dependabot/maven/com.github.jnr-jnr-posix-3.1.3
     new f18fc16  ISIS-2468 : renames NotPersistedFacet to MementoSerializatinExcludeFacet
     new bbeec0f  ISIS-2468: completes renaming of NotPersistedFacet
     new b99bcf4  ISIS-2444: adds xmlsnapshot example
     new fadd804  ISIS-2444: excludes mementoSerialization for contributed properties
     new 0db9337  ISIS-2444: adds another property
     new 43ad6aa  ISIS-2444: adds memento serialization example
     new 13326ec  ISIS-2444: deletes unused file

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../MementoSerializationExcludeFacet.java}         |   7 +-
 .../MementoSerializationExcludeFacetAbstract.java} |   8 +-
 .../propcoll/notpersisted/NotPersistedFacet.java   |  38 ------
 .../notpersisted/NotPersistedFacetAbstract.java    |  36 ------
 .../property/PropertyAnnotationFacetFactory.java   |  36 +++---
 ...lizationExcludeFacetForPropertyAnnotation.java} |  12 +-
 .../update/NotPersistableFacetInferred.java        |   4 +-
 .../metamodel/spec/feature/ObjectAssociation.java  |  61 ++++------
 .../spec/feature/OneToOneAssociation.java          |   5 +-
 .../specimpl/ObjectAssociationAbstract.java        |  13 +--
 .../specimpl/OneToManyAssociationDefault.java      |   1 -
 .../specimpl/OneToManyAssociationMixedIn.java      |  20 ++--
 .../core/metamodel/util/snapshot/XmlSnapshot.java  |  11 +-
 .../PropertyMethodsFacetFactoryTest.java           |  10 +-
 ...sistedAnnotationOnPropertyFacetFactoryTest.java |  10 +-
 .../PropertyAnnotationFacetFactoryTest.java        |  38 +++---
 .../specimpl/ObjectAssociationAbstractTest.java    |  20 ----
 ...t.java => OneToOneAssociationAbstractTest.java} |  46 ++------
 .../changetracking/EntityChangeTrackerDefault.java |  58 +++++-----
 .../HasAsciiDocDescription_description.java        |   3 +-
 .../HasAsciiDocDescription_sources.java            |   3 +-
 .../child/ActionAssociateWithVm-description.adoc   |   2 +-
 .../Collection/mementoSerialization/.gitkeep       |   0
 .../dom/annotDomain/Property/PropertyMenu.java     |   9 +-
 .../Property/mementoSerialization/.gitkeep         |   0
 ...ementoSerializationExcludedMetaAnnotation.java} |  10 +-
 ...ementoSerializationIncludedMetaAnnotation.java} |  10 +-
 ...ropertyMementoSerializationVm-description.adoc} |   0
 .../PropertyMementoSerializationVm.java            | 127 +++++++++++++++++++++
 .../PropertyMementoSerializationVm.layout.xml}     |  14 +--
 ...opertyMementoSerializationVm_takeSnapshot.java} |  41 ++++---
 .../src/main/java/demoapp/dom/menubars.layout.xml  |   1 +
 .../java/demoapp/dom/services/ServicesMenu.java    |  23 +++-
 .../XmlSnapshotParentVm-description.adoc}          |   0
 .../xmlSnapshotService/XmlSnapshotParentVm.java}   |  71 +++++++-----
 .../XmlSnapshotParentVm.layout.xml}                |   3 +-
 .../XmlSnapshotParentVm_takeSnapshot.java          | 112 ++++++++++++++++++
 .../child/XmlSnapshotChildVm-description.adoc}     |   2 +-
 .../child/XmlSnapshotChildVm.java}                 |  14 +--
 .../child/XmlSnapshotChildVm.layout.xml}           |   0
 .../peer/XmlSnapshotPeerVm-description.adoc        |   5 +-
 .../peer/XmlSnapshotPeerVm.java}                   |  16 ++-
 .../peer/XmlSnapshotPeerVm.layout.xml}             |   0
 ...ndatoryFromJdoColumnAnnotationFacetFactory.java |  30 ++---
 .../JdoNotPersistentAnnotationFacetFactory.java    |   6 -
 ...FacetDerivedFromJdoNotPersistentAnnotation.java |  31 -----
 ...JdoNotPersistentAnnotationFacetFactoryTest.java |  14 +--
 47 files changed, 533 insertions(+), 448 deletions(-)
 copy core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/{jaxb/XmlTransientFacet.java => propcoll/memserexcl/MementoSerializationExcludeFacet.java} (78%)
 copy core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/{object/value/EqualByContentFacetAbstract.java => propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java} (77%)
 delete mode 100644 core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacet.java
 delete mode 100644 core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacetAbstract.java
 rename core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/{NotPersistedFacetForPropertyAnnotation.java => MementoSerializationExcludeFacetForPropertyAnnotation.java} (71%)
 copy core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/{ObjectAssociationAbstractTest.java => OneToOneAssociationAbstractTest.java} (78%)
 delete mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Collection/mementoSerialization/.gitkeep
 delete mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/.gitkeep
 copy examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/{commandPublishing/PropertyCommandPublishingDisabledMetaAnnotation.java => mementoSerialization/MementoSerializationExcludedMetaAnnotation.java} (77%)
 copy examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/{commandPublishing/PropertyCommandPublishingDisabledMetaAnnotation.java => mementoSerialization/MementoSerializationIncludedMetaAnnotation.java} (77%)
 copy examples/demo/domain/src/main/java/demoapp/dom/annotDomain/{Action/associateWith/ActionAssociateWithVm-description.adoc => Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc} (100%)
 create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
 copy examples/demo/domain/src/main/java/demoapp/dom/annotDomain/{Action/associateWith/ActionAssociateWithVm.layout.xml => Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml} (88%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotLayout/PropertyLayout/renderDay/PropertyLayoutRenderDayVm_downloadAsXml.java => annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java} (54%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Action/associateWith/ActionAssociateWithVm-description.adoc => services/xmlSnapshotService/XmlSnapshotParentVm-description.adoc} (100%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Property/projecting/PropertyProjectingVm.java => services/xmlSnapshotService/XmlSnapshotParentVm.java} (54%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Collection/domainEvent/child/CollectionDomainEventChildVm.layout.xml => services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml} (97%)
 create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc => services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc} (92%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Action/associateWith/child/ActionAssociateWithChildVm.java => services/xmlSnapshotService/child/XmlSnapshotChildVm.java} (85%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Action/typeOf/child/ActionTypeOfVm.layout.xml => services/xmlSnapshotService/child/XmlSnapshotChildVm.layout.xml} (100%)
 copy antora/components/conguide/modules/documentation/pages/tooling.adoc => examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc (89%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Action/associateWith/child/ActionAssociateWithChildVm.java => services/xmlSnapshotService/peer/XmlSnapshotPeerVm.java} (84%)
 copy examples/demo/domain/src/main/java/demoapp/dom/{annotDomain/Action/typeOf/child/ActionTypeOfVm.layout.xml => services/xmlSnapshotService/peer/XmlSnapshotPeerVm.layout.xml} (100%)
 delete mode 100644 persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/NotPersistedFacetDerivedFromJdoNotPersistentAnnotation.java


[isis] 05/07: ISIS-2444: adds another property

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 0db9337c45df5c7698831d752e9b6a27583a95dc
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Nov 26 17:03:14 2020 +0000

    ISIS-2444: adds another property
---
 .../services/xmlSnapshotService/XmlSnapshotParentVm.java  | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
index 62193e8..85611c3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
@@ -20,7 +20,6 @@ package demoapp.dom.services.xmlSnapshotService;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -28,17 +27,14 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.Collection;
 import org.apache.isis.applib.annotation.CollectionLayout;
 import org.apache.isis.applib.annotation.DomainObject;
 import org.apache.isis.applib.annotation.Editing;
 import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.MementoSerialization;
 import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.Property;
-import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService;
 
 import lombok.Getter;
 import lombok.NoArgsConstructor;
@@ -61,6 +57,7 @@ public class XmlSnapshotParentVm implements HasAsciiDocDescription {
 
     public XmlSnapshotParentVm(String text) {
         this.text = text;
+        this.otherText = text;
     }
 
     public String title() {
@@ -73,8 +70,14 @@ public class XmlSnapshotParentVm implements HasAsciiDocDescription {
     @Getter @Setter
     private String text;
 
-    @Property(editing = Editing.ENABLED)
+    @Property(editing = Editing.ENABLED, mementoSerialization = MementoSerialization.EXCLUDED)
     @MemberOrder(name = "properties", sequence = "2")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String otherText;
+
+    @Property(editing = Editing.ENABLED)
+    @MemberOrder(name = "properties", sequence = "3")
     @XmlElement(required = false)
     @Getter @Setter
     private XmlSnapshotPeerVm peer;


[isis] 06/07: ISIS-2444: adds memento serialization example

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 43ad6aa122d819e20dc5fd610e11622f703485cc
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Nov 26 18:59:29 2020 +0000

    ISIS-2444: adds memento serialization example
---
 .../child/ActionAssociateWithVm-description.adoc   |   2 +-
 .../Collection/mementoSerialization/.gitkeep       |   0
 .../dom/annotDomain/Property/PropertyMenu.java     |   9 +-
 ...MementoSerializationExcludedMetaAnnotation.java |  40 ++++++
 ...MementoSerializationIncludedMetaAnnotation.java |  40 ++++++
 ...PropertyMementoSerializationVm-description.adoc | 135 +++++++++++++++++++++
 .../PropertyMementoSerializationVm.java            | 127 +++++++++++++++++++
 .../PropertyMementoSerializationVm.layout.xml}     |  12 +-
 ...ropertyMementoSerializationVm_takeSnapshot.java |  68 +++++++++++
 .../java/demoapp/dom/services/ServicesMenu.java    |  14 +--
 .../xmlSnapshotService/XmlSnapshotParentVm.java    |   7 +-
 .../XmlSnapshotParentVm.layout.xml                 |   4 +-
 .../XmlSnapshotParentVm_takeSnapshot.java          |  26 ++--
 .../child/XmlSnapshotChildVm-description.adoc      |   2 +-
 .../{child => }/XmlSnapshotPeerVm-description.adoc |   2 +-
 .../peer/{child => }/XmlSnapshotPeerVm.java        |   2 +-
 .../peer/{child => }/XmlSnapshotPeerVm.layout.xml  |   0
 17 files changed, 447 insertions(+), 43 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
index bc9d16d..e755465 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: 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 ag [...]
 
-This child object exists just to act as the element of the two collections of the `XmlSnapshotParentVm` demo object.
+This child object exists just to act as the element of the two collections of the `PropertyMementoSerializationVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Collection/mementoSerialization/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Collection/mementoSerialization/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
index 6aa43c8..aaf17a7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
@@ -30,6 +30,7 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.value.Blob;
 import org.apache.isis.applib.value.Clob;
 
+import demoapp.dom.annotDomain.Property.mementoSerialization.PropertyMementoSerializationVm;
 import lombok.RequiredArgsConstructor;
 import lombok.val;
 
@@ -120,7 +121,6 @@ public class PropertyMenu {
         return vm;
     }
 
-
     @Action(semantics = SemanticsOf.SAFE)
     @ActionLayout(cssClassFa="fa-ruler-horizontal", describedAs = "Length of text fields")
     public PropertyMaxLengthVm maxLength(){
@@ -132,6 +132,13 @@ public class PropertyMenu {
     }
 
     @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(cssClassFa="fa-camera", describedAs = "Snapshot inclusion/exclusion")
+    public PropertyMementoSerializationVm mementoSerialization(){
+        val vm = new PropertyMementoSerializationVm("value");
+        return new PropertyMementoSerializationVm("value");
+    }
+
+    @Action(semantics = SemanticsOf.SAFE)
     @ActionLayout(cssClassFa="fa-star-half-alt", describedAs = "Regular expressions, such as email")
     public PropertyMustSatisfyVm mustSatisfy(){
         val vm = new PropertyMustSatisfyVm();
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationExcludedMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationExcludedMetaAnnotation.java
new file mode 100644
index 0000000..e8d399c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationExcludedMetaAnnotation.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.annotDomain.Property.mementoSerialization;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Property;
+
+//tag::class[]
+@Property(mementoSerialization = MementoSerialization.EXCLUDED) // <.>
+@Inherited
+@Target({
+        ElementType.METHOD, ElementType.FIELD                   // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MementoSerializationExcludedMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationIncludedMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationIncludedMetaAnnotation.java
new file mode 100644
index 0000000..c7725c1
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationIncludedMetaAnnotation.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.annotDomain.Property.mementoSerialization;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Property;
+
+//tag::class[]
+@Property(mementoSerialization = MementoSerialization.INCLUDED) // <.>
+@Inherited
+@Target({
+        ElementType.METHOD, ElementType.FIELD                   // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MementoSerializationIncludedMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
new file mode 100644
index 0000000..a86fcdc
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
@@ -0,0 +1,135 @@
+:Notice: 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 ag [...]
+
+The `associateWith` element specifies an action has a relationship with another property or another collection of the domain class.
+
+* For properties, the association (currently) is used solely for layout purposes, so that the action will by default be rendered close to the property.
++
+This can of course be overridden using `@ActionLayout` or the layout file
+
+* For collections, the association is also used for layout purposes, rendering the action near to the collection.
++
+However, it is also used at a deeper level, because the action may have a collection parameter which is the same type as the collection elements.
+In the Wicket viewer, the collection is rendered with checkboxes; those selected objects are used as defaults for the action collection parameter.
+
+
+== Associated with Properties
+
+The `AssociateWithVm` class defines two properties, `text` and `anotherProperty`:
+
+[source,java]
+----
+include::ActionAssociateWithVm.java[tags=class-properties]
+----
+
+The regular `updateText` action is associated with the `text` property:
+
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-property]
+----
+<.> indicates the property to associate with
+<.> if there are multiple actions associated with the property, indicates their order in the UI
+
+Meanwhile the mixin `updateOtherProperty` is associated with the `otherProperty` property:
+
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm_updateOtherProperty.java[tags=class]
+----
+<.> indicates the property to associate with
+<.> indicates their order in the UI
+
+
+== Collection
+
+The `AssociateWithVm` class also defines the `children` collection:
+
+[source,java]
+----
+include::ActionAssociateWithVm.java[tags=class-collections-children]
+----
+
+There are three actions associated with this collection:
+
+* the `addChild` action:
++
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-children-1]
+----
+<.> associates with the "children" collection
+<.> positioned first in the UI
+
+* the `removeChild` action.
++
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-children-2]
+----
+<.> associates with the "children" collection
+<.> positioned second in the UI
+<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
+Instead, the elements in the collection are automatically used.
+
++
+TIP: an explicit `choices()` or `autoComplete(...)` supporting method can be provided to override the default usage of the collection elements if required.
+
+* the `removeChildren` action, which allows multiple children to be removed:
++
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-children-3]
+----
+<.> associates with the "children" collection
+<.> positioned third in the UI
+<.> again, no supporting `choices()` or `autoComplete(...)` method is required.
+Instead, the elements of the collection are used as options.
+Also, each row in the collection is rendered with a checkbox, and those selected are used as the default for the parameter.
+
+== Mixin Actions
+
+The `AssociateWithVm` class also defines the `favorites` collection:
+
+[source,java]
+----
+include::ActionAssociateWithVm.java[tags=class-collections-favorites]
+----
+
+There are three mixin actions associated with this collection:
+
+* the `makeFavorite` action.
+This takes a element from the "children" collectio and also adds to the "favorites" collection:
++
+[source,java]
+----
+include::child/ActionAssociateWithVm_makeFavorite.java[tags=class]
+----
+<.> associates with the "favorites" collection
+<.> positioned first in the UI
+<.> choices are taken from the "children" collection
+
+* the `noLongerFavorite` action.
+This just removes a selected element from the "children" collection:
++
+[source,java]
+----
+include::child/ActionAssociateWithVm_noLongerFavorite.java[tags=class]
+----
+<.> associates with the "children" collection
+<.> positioned second in the UI
+<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
+Instead, the elements in the collection are automatically used.
+
+* the `noLongerFavorites` action.
+This is similar to the previous action, but for multiple favorite elements:
++
+[source,java]
+----
+include::child/ActionAssociateWithVm_noLongerFavorites.java[tags=class]
+----
+<.> associates with the "favorites" collection
+<.> positioned third in the UI
+<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
+Instead, the elements in the collection are automatically used.
+
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
new file mode 100644
index 0000000..a4e2f26
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
@@ -0,0 +1,127 @@
+/*
+ *  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 demoapp.dom.annotDomain.Property.mementoSerialization;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+    nature=Nature.VIEW_MODEL,
+    objectType = "demo.PropertyMementoSerializationVm",
+    editing = Editing.ENABLED
+)
+@NoArgsConstructor
+public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
+
+    public PropertyMementoSerializationVm(String text) {
+        this.text = text;
+        this.excludedProperty = text;
+        this.includedProperty = text;
+        this.notSpecifiedProperty = text;
+        this.metaAnnotatedProperty = text;
+        this.metaAnnotatedPropertyOverridden = text;
+    }
+
+    public String title() {
+        return "PropertyMementoSerializationVm";
+    }
+
+    @Property()
+    @MemberOrder(name = "no-annotations", sequence = "1")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String text;
+
+    @Property(
+        mementoSerialization = MementoSerialization.NOT_SPECIFIED
+    )
+    @PropertyLayout(
+        describedAs = "@Property(mementoSerialization = NOT_SPECIFIED)"
+    )
+    @MemberOrder(name = "annotations", sequence = "1")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String notSpecifiedProperty;
+
+    @Property(
+        mementoSerialization = MementoSerialization.EXCLUDED
+    )
+    @PropertyLayout(
+        describedAs = "@Property(mementoSerialization = EXCLUDED)"
+    )
+    @MemberOrder(name = "annotations", sequence = "2")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String excludedProperty;
+
+    @Property(
+        mementoSerialization = MementoSerialization.INCLUDED
+    )
+    @PropertyLayout(
+        describedAs = "@Property(mementoSerialization = INCLUDED)"
+    )
+    @MemberOrder(name = "annotations", sequence = "2")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String includedProperty;
+
+    @MementoSerializationExcludedMetaAnnotation     // <.>
+    @Property()
+    @PropertyLayout(
+        describedAs = "@MementoSerializationExcludedMetaAnnotation "
+    )
+    @MemberOrder(name = "meta-annotations", sequence = "1")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String metaAnnotatedProperty;
+
+    @MementoSerializationIncludedMetaAnnotation                 // <.>
+    @Property(
+        mementoSerialization = MementoSerialization.EXCLUDED    // <.>
+    )
+    @PropertyLayout(
+        describedAs =
+            "@MementoSerializationIncludedMetaAnnotation "
+            + "@Property(mementoSerialization = EXCLUDED)"
+    )
+    @MemberOrder(name = "meta-annotations-overridden", sequence = "1")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String metaAnnotatedPropertyOverridden;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
similarity index 90%
copy from examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
copy to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
index 1a69b0c..8c2abe6 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
@@ -29,17 +29,13 @@
 		<bs3:col span="6">
 			<bs3:row>
 				<bs3:col span="12">
-					<cpt:fieldSet name="Properties" id="annotation"/>
+					<cpt:fieldSet name="Not annotated" id="no-annotations"/>
+					<cpt:fieldSet name="Annotated" id="annotations"/>
+					<cpt:fieldSet name="Meta-annotated" id="meta-annotations"/>
+					<cpt:fieldSet name="Meta-annotated overrriden" id="meta-annotated-overrriden"/>
 					<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
 				</bs3:col>
 			</bs3:row>
-			<bs3:row>
-				<bs3:col span="12">
-					<cpt:collection id="children"/>
-					<cpt:collection id="favorites"/>
-					<cpt:collection id="mixinChildren"/>
-				</bs3:col>
-			</bs3:row>
 		</bs3:col>
 		<bs3:col span="6">
 			<cpt:fieldSet name="Description" id="description" >
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
new file mode 100644
index 0000000..7e97ae8
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
@@ -0,0 +1,68 @@
+/*
+ *  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 demoapp.dom.annotDomain.Property.mementoSerialization;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.xml.XmlService;
+import org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService;
+import org.apache.isis.applib.value.Clob;
+
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+//tag::class[]
+@Action(
+    semantics = SemanticsOf.SAFE
+)
+@RequiredArgsConstructor
+public class PropertyMementoSerializationVm_takeSnapshot {
+
+    @Inject
+    XmlSnapshotService xmlSnapshotService;
+    @Inject
+    XmlService xmlService;
+
+    // ...
+//end::class[]
+
+    private final PropertyMementoSerializationVm propertyMementoSerializationVm;
+
+
+//tag::class[]
+    public Clob act() {
+        return snapshotUsing(propertyMementoSerializationVm);
+    }
+
+    private Clob snapshotUsing(
+            final Object parentVm) {
+        val builder = xmlSnapshotService.builderFor(parentVm);
+        val snapshot = builder.build();
+        val doc = snapshot.getXmlDocument();
+        return asClob(xmlService.asString(doc));
+    }
+
+
+    private static Clob asClob(final String xmlStr) {
+        return new Clob("snapshot.xml", "application/xml", xmlStr);
+    }
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java
index 2bc47a3..2ea837f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java
@@ -26,14 +26,13 @@ import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.RequiredArgsConstructor;
-import lombok.val;
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom.services.wrapperFactory.WrapperFactoryJdo;
 import demoapp.dom.services.wrapperFactory.WrapperFactoryJdoEntities;
 import demoapp.dom.services.xmlSnapshotService.XmlSnapshotParentVm;
-import demoapp.dom.services.xmlSnapshotService.peer.child.XmlSnapshotPeerVm;
+import demoapp.dom.services.xmlSnapshotService.peer.XmlSnapshotPeerVm;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.log4j.Log4j2;
+import lombok.val;
 
 @DomainService(nature=NatureOfService.VIEW, objectType = "demo.ServicesMenu")
 @Log4j2
@@ -49,13 +48,12 @@ public class ServicesMenu {
     }
 
     @Action(semantics = SemanticsOf.SAFE)
-    @ActionLayout(cssClassFa="fa-gift", describedAs = "Snapshot object graphs as XML")
+    @ActionLayout(cssClassFa="fa-camera", describedAs = "Snapshot object graphs as XML")
     public XmlSnapshotParentVm xmlSnapshot(){
 
         val parentVm = new XmlSnapshotParentVm("parent object");
 
-        val peerVm = new XmlSnapshotPeerVm("peer object");
-        parentVm.setPeer(peerVm);
+        parentVm.setPeer(new XmlSnapshotPeerVm("peer object"));
 
         parentVm.addChild("child 1");
         parentVm.addChild("child 2");
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
index 85611c3..22daa66 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
@@ -36,15 +36,14 @@ import org.apache.isis.applib.annotation.MementoSerialization;
 import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.Property;
 
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.services.xmlSnapshotService.child.XmlSnapshotChildVm;
+import demoapp.dom.services.xmlSnapshotService.peer.XmlSnapshotPeerVm;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
 import lombok.val;
 
-import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.services.xmlSnapshotService.child.XmlSnapshotChildVm;
-import demoapp.dom.services.xmlSnapshotService.peer.child.XmlSnapshotPeerVm;
-
 @XmlRootElement(name = "root")
 @XmlType
 @XmlAccessorType(XmlAccessType.FIELD)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
index 1a69b0c..a7640cd 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
@@ -29,15 +29,13 @@
 		<bs3:col span="6">
 			<bs3:row>
 				<bs3:col span="12">
-					<cpt:fieldSet name="Properties" id="annotation"/>
+					<cpt:fieldSet name="Properties" id="properties"/>
 					<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
 				</bs3:col>
 			</bs3:row>
 			<bs3:row>
 				<bs3:col span="12">
 					<cpt:collection id="children"/>
-					<cpt:collection id="favorites"/>
-					<cpt:collection id="mixinChildren"/>
 				</bs3:col>
 			</bs3:row>
 		</bs3:col>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
index 7b8179c..b1cea7f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
@@ -29,6 +29,7 @@ import org.w3c.dom.Document;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.xml.XmlService;
 import org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService;
 import org.apache.isis.applib.value.Clob;
 
@@ -45,6 +46,8 @@ public class XmlSnapshotParentVm_takeSnapshot {
 
     @Inject
     XmlSnapshotService xmlSnapshotService;
+    @Inject
+    XmlService xmlService;
 
     // ...
 //end::class[]
@@ -54,7 +57,7 @@ public class XmlSnapshotParentVm_takeSnapshot {
 
 //tag::class[]
     public Clob act(Demo demo) {
-        return demo.snapshotUsing(xmlSnapshotService, xmlSnapshotParentVm);
+        return demo.snapshotUsing(xmlSnapshotParentVm, xmlSnapshotService, xmlService);
     }
 
     public Demo default0Act() {
@@ -87,30 +90,23 @@ public class XmlSnapshotParentVm_takeSnapshot {
             }
         };
 
-        public final Clob snapshotUsing(XmlSnapshotService xmlSnapshotService, Object parentVm) {
+        public final Clob snapshotUsing(
+                final Object parentVm,
+                final XmlSnapshotService xmlSnapshotService,
+                final XmlService xmlService) {
             val builder = xmlSnapshotService.builderFor(parentVm);
             refine(builder);
             XmlSnapshotService.Snapshot snapshot = builder.build();
             val doc = snapshot.getXmlDocument();
-            return Demo.asClob(doc, this);
+            return Demo.asClob(xmlService.asString(doc), this);
         }
 
         abstract void refine(XmlSnapshotService.Snapshot.Builder builder);
 
-        private static Clob asClob(final Document document, final Demo demo) {
-            return new Clob(demo.name() + ".xml", "application/xml", asChars(document));
+        private static Clob asClob(final String xmlStr, final Demo demo) {
+            return new Clob(demo.name() + ".xml", "application/xml", xmlStr);
         }
 
-        @SneakyThrows
-        private static CharSequence asChars(Document document) {
-            val domSource = new DOMSource(document);
-            val writer = new StringWriter();
-            val result = new StreamResult(writer);
-            val tf = TransformerFactory.newInstance();
-            val transformer = tf.newTransformer();
-            transformer.transform(domSource, result);
-            return writer.toString();
-        }
     }
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
index bc9d16d..e755465 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: 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 ag [...]
 
-This child object exists just to act as the element of the two collections of the `XmlSnapshotParentVm` demo object.
+This child object exists just to act as the element of the two collections of the `PropertyMementoSerializationVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
similarity index 89%
rename from examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm-description.adoc
rename to examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
index c3eaa0f..a2f1be1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: 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 ag [...]
 
-This object exists just to be referenced by the `XmlSnapshotParentVm` demo object.
+This object exists just to be referenced by the `PropertyMementoSerializationVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm.java
similarity index 97%
rename from examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.java
rename to examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm.java
index 7429bc6..bd6706c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.services.xmlSnapshotService.peer.child;
+package demoapp.dom.services.xmlSnapshotService.peer;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm.layout.xml
similarity index 100%
rename from examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.layout.xml
rename to examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/XmlSnapshotPeerVm.layout.xml


[isis] 03/07: ISIS-2444: adds xmlsnapshot example

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit b99bcf4cae05f3a81b319c60f832c40a22a3f16b
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Nov 26 12:50:15 2020 +0000

    ISIS-2444: adds xmlsnapshot example
---
 .../child/ActionAssociateWithVm-description.adoc   |   2 +-
 .../src/main/java/demoapp/dom/menubars.layout.xml  |   1 +
 .../java/demoapp/dom/services/ServicesMenu.java    |  19 +++
 .../XmlSnapshotParentVm-description.adoc           | 135 +++++++++++++++++++++
 .../xmlSnapshotService/XmlSnapshotParentVm.java    |  97 +++++++++++++++
 .../XmlSnapshotParentVm.layout.xml                 |  62 ++++++++++
 .../XmlSnapshotParentVm_takeSnapshot.java          | 116 ++++++++++++++++++
 .../child/XmlSnapshotChildVm-description.adoc}     |   2 +-
 .../child/XmlSnapshotChildVm.java                  |  64 ++++++++++
 .../child/XmlSnapshotChildVm.layout.xml            |  52 ++++++++
 .../peer/child/XmlSnapshotPeerVm-description.adoc} |   2 +-
 .../peer/child/XmlSnapshotPeerVm.java              |  64 ++++++++++
 .../peer/child/XmlSnapshotPeerVm.layout.xml        |  52 ++++++++
 13 files changed, 665 insertions(+), 3 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
index f7e4277..bc9d16d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: 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 ag [...]
 
-This child object exists just to act as the element of the two collections of the `ActionAssociateWithVm` demo object.
+This child object exists just to act as the element of the two collections of the `XmlSnapshotParentVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index db802ad..0173768 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -176,6 +176,7 @@ For latest we use: https://raw.githubusercontent.com/apache/isis/master/antora/s
             <mb3:named>Services</mb3:named>
             <mb3:section>
                 <mb3:serviceAction objectType="demo.ServicesMenu" id="wrapperFactory"/>
+                <mb3:serviceAction objectType="demo.ServicesMenu" id="xmlSnapshot"/>
             </mb3:section>
         </mb3:menu>
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java
index 7163f41..2bc47a3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/ServicesMenu.java
@@ -27,10 +27,13 @@ import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
 import lombok.RequiredArgsConstructor;
+import lombok.val;
 import lombok.extern.log4j.Log4j2;
 
 import demoapp.dom.services.wrapperFactory.WrapperFactoryJdo;
 import demoapp.dom.services.wrapperFactory.WrapperFactoryJdoEntities;
+import demoapp.dom.services.xmlSnapshotService.XmlSnapshotParentVm;
+import demoapp.dom.services.xmlSnapshotService.peer.child.XmlSnapshotPeerVm;
 
 @DomainService(nature=NatureOfService.VIEW, objectType = "demo.ServicesMenu")
 @Log4j2
@@ -45,4 +48,20 @@ public class ServicesMenu {
         return wrapperFactoryJdoEntities.first();
     }
 
+    @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(cssClassFa="fa-gift", describedAs = "Snapshot object graphs as XML")
+    public XmlSnapshotParentVm xmlSnapshot(){
+
+        val parentVm = new XmlSnapshotParentVm("parent object");
+
+        val peerVm = new XmlSnapshotPeerVm("peer object");
+        parentVm.setPeer(peerVm);
+
+        parentVm.addChild("child 1");
+        parentVm.addChild("child 2");
+        parentVm.addChild("child 3");
+
+        return parentVm;
+    }
+
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm-description.adoc
new file mode 100644
index 0000000..a86fcdc
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm-description.adoc
@@ -0,0 +1,135 @@
+:Notice: 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 ag [...]
+
+The `associateWith` element specifies an action has a relationship with another property or another collection of the domain class.
+
+* For properties, the association (currently) is used solely for layout purposes, so that the action will by default be rendered close to the property.
++
+This can of course be overridden using `@ActionLayout` or the layout file
+
+* For collections, the association is also used for layout purposes, rendering the action near to the collection.
++
+However, it is also used at a deeper level, because the action may have a collection parameter which is the same type as the collection elements.
+In the Wicket viewer, the collection is rendered with checkboxes; those selected objects are used as defaults for the action collection parameter.
+
+
+== Associated with Properties
+
+The `AssociateWithVm` class defines two properties, `text` and `anotherProperty`:
+
+[source,java]
+----
+include::ActionAssociateWithVm.java[tags=class-properties]
+----
+
+The regular `updateText` action is associated with the `text` property:
+
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-property]
+----
+<.> indicates the property to associate with
+<.> if there are multiple actions associated with the property, indicates their order in the UI
+
+Meanwhile the mixin `updateOtherProperty` is associated with the `otherProperty` property:
+
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm_updateOtherProperty.java[tags=class]
+----
+<.> indicates the property to associate with
+<.> indicates their order in the UI
+
+
+== Collection
+
+The `AssociateWithVm` class also defines the `children` collection:
+
+[source,java]
+----
+include::ActionAssociateWithVm.java[tags=class-collections-children]
+----
+
+There are three actions associated with this collection:
+
+* the `addChild` action:
++
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-children-1]
+----
+<.> associates with the "children" collection
+<.> positioned first in the UI
+
+* the `removeChild` action.
++
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-children-2]
+----
+<.> associates with the "children" collection
+<.> positioned second in the UI
+<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
+Instead, the elements in the collection are automatically used.
+
++
+TIP: an explicit `choices()` or `autoComplete(...)` supporting method can be provided to override the default usage of the collection elements if required.
+
+* the `removeChildren` action, which allows multiple children to be removed:
++
+[source,java,indent=0]
+----
+include::ActionAssociateWithVm.java[tags=action-associateWith-children-3]
+----
+<.> associates with the "children" collection
+<.> positioned third in the UI
+<.> again, no supporting `choices()` or `autoComplete(...)` method is required.
+Instead, the elements of the collection are used as options.
+Also, each row in the collection is rendered with a checkbox, and those selected are used as the default for the parameter.
+
+== Mixin Actions
+
+The `AssociateWithVm` class also defines the `favorites` collection:
+
+[source,java]
+----
+include::ActionAssociateWithVm.java[tags=class-collections-favorites]
+----
+
+There are three mixin actions associated with this collection:
+
+* the `makeFavorite` action.
+This takes a element from the "children" collectio and also adds to the "favorites" collection:
++
+[source,java]
+----
+include::child/ActionAssociateWithVm_makeFavorite.java[tags=class]
+----
+<.> associates with the "favorites" collection
+<.> positioned first in the UI
+<.> choices are taken from the "children" collection
+
+* the `noLongerFavorite` action.
+This just removes a selected element from the "children" collection:
++
+[source,java]
+----
+include::child/ActionAssociateWithVm_noLongerFavorite.java[tags=class]
+----
+<.> associates with the "children" collection
+<.> positioned second in the UI
+<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
+Instead, the elements in the collection are automatically used.
+
+* the `noLongerFavorites` action.
+This is similar to the previous action, but for multiple favorite elements:
++
+[source,java]
+----
+include::child/ActionAssociateWithVm_noLongerFavorites.java[tags=class]
+----
+<.> associates with the "favorites" collection
+<.> positioned third in the UI
+<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
+Instead, the elements in the collection are automatically used.
+
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
new file mode 100644
index 0000000..62193e8
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.java
@@ -0,0 +1,97 @@
+/*
+ *  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 demoapp.dom.services.xmlSnapshotService;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.CollectionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.val;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.services.xmlSnapshotService.child.XmlSnapshotChildVm;
+import demoapp.dom.services.xmlSnapshotService.peer.child.XmlSnapshotPeerVm;
+
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+    nature=Nature.VIEW_MODEL,
+    objectType = "demo.XmlSnapshotParentVm"
+)
+@NoArgsConstructor
+public class XmlSnapshotParentVm implements HasAsciiDocDescription {
+
+    public XmlSnapshotParentVm(String text) {
+        this.text = text;
+    }
+
+    public String title() {
+        return "XmlSnapshotService parent VM";
+    }
+
+    @Property(editing = Editing.ENABLED)
+    @MemberOrder(name = "properties", sequence = "1")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private String text;
+
+    @Property(editing = Editing.ENABLED)
+    @MemberOrder(name = "properties", sequence = "2")
+    @XmlElement(required = false)
+    @Getter @Setter
+    private XmlSnapshotPeerVm peer;
+
+//tag::class-collections-children[]
+    @Collection()
+    @CollectionLayout()
+    @Getter
+    private List<XmlSnapshotChildVm> children = new ArrayList<>();
+
+    // ...
+//end::class-collections-children[]
+
+    public XmlSnapshotParentVm addChild(final String value) {
+        val childVm = new XmlSnapshotChildVm(value);
+        getChildren().add(childVm);
+        return this;
+    }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
new file mode 100644
index 0000000..1a69b0c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm.layout.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- 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. -->
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd   http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+        xmlns:cpt="http://isis.apache.org/applib/layout/component"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+	<bs3:row>
+		<bs3:col span="10" unreferencedActions="true">
+			<cpt:domainObject />
+			<cpt:action id="takeSnapshot"/>
+		</bs3:col>
+		<bs3:col span="2">
+			<cpt:fieldSet name="" id="sources" />
+		</bs3:col>
+	</bs3:row>
+
+	<bs3:row>
+		<bs3:col span="6">
+			<bs3:row>
+				<bs3:col span="12">
+					<cpt:fieldSet name="Properties" id="annotation"/>
+					<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+				</bs3:col>
+			</bs3:row>
+			<bs3:row>
+				<bs3:col span="12">
+					<cpt:collection id="children"/>
+					<cpt:collection id="favorites"/>
+					<cpt:collection id="mixinChildren"/>
+				</bs3:col>
+			</bs3:row>
+		</bs3:col>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Description" id="description" >
+				<cpt:action id="clearHints" position="PANEL" />
+				<cpt:action id="downloadLayoutXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="rebuildMetamodel" position="PANEL"/>
+				<cpt:action id="downloadMetamodelXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="downloadJdoMetadata"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+				<cpt:property id="description"/>
+			</cpt:fieldSet>
+		</bs3:col>
+	</bs3:row>
+	<bs3:row>
+		<bs3:col span="12" unreferencedCollections="true"/>
+	</bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
new file mode 100644
index 0000000..554a10f
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
@@ -0,0 +1,116 @@
+/*
+ *  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 demoapp.dom.services.xmlSnapshotService;
+
+import java.io.StringWriter;
+
+import javax.inject.Inject;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.services.xmlsnapshot.XmlSnapshotService;
+import org.apache.isis.applib.value.Clob;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import lombok.val;
+
+//tag::class[]
+@Action(
+    semantics = SemanticsOf.SAFE
+)
+@RequiredArgsConstructor
+public class XmlSnapshotParentVm_takeSnapshot {
+
+    @Inject
+    XmlSnapshotService xmlSnapshotService;
+
+    // ...
+//end::class[]
+
+    private final XmlSnapshotParentVm xmlSnapshotParentVm;
+
+
+//tag::class[]
+    public Clob act(Demo demo) {
+        return demo.snapshotUsing(xmlSnapshotService, xmlSnapshotParentVm);
+    }
+
+    public Demo default0Act() {
+        return Demo.VANILLA;
+    }
+
+    public enum Demo {
+        VANILLA {
+            @Override
+            void refine(XmlSnapshotService.Snapshot.Builder builder) {
+            }
+        }
+        , WITH_PEER {
+            @Override
+            void refine(XmlSnapshotService.Snapshot.Builder builder) {
+                builder.includePath("peer");
+            }
+        }
+        , WITH_CHILDREN {
+            @Override
+            void refine(XmlSnapshotService.Snapshot.Builder builder) {
+                builder.includePath("children");
+            }
+        }
+        , WITH_PEER_AND_CHILDREN {
+            @Override
+            void refine(XmlSnapshotService.Snapshot.Builder builder) {
+                builder.includePath("peer");
+                builder.includePath("children");
+            }
+        };
+
+        public final Clob snapshotUsing(XmlSnapshotService xmlSnapshotService, Object parentVm) {
+            val builder = xmlSnapshotService.builderFor(parentVm);
+            refine(builder);
+            XmlSnapshotService.Snapshot snapshot = builder.build();
+            val doc = snapshot.getXmlDocument();
+            return Demo.asClob(doc, this);
+        }
+
+        abstract void refine(XmlSnapshotService.Snapshot.Builder builder);
+
+        private static Clob asClob(final Document document, final Demo demo) {
+            return new Clob(demo.name(), "application/xml", asChars(document));
+        }
+
+        @SneakyThrows
+        private static CharSequence asChars(Document document) {
+            val domSource = new DOMSource(document);
+            val writer = new StringWriter();
+            val result = new StreamResult(writer);
+            val tf = TransformerFactory.newInstance();
+            val transformer = tf.newTransformer();
+            transformer.transform(domSource, result);
+            return writer.toString();
+        }
+    }
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
similarity index 93%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
copy to examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
index f7e4277..bc9d16d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: 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 ag [...]
 
-This child object exists just to act as the element of the two collections of the `ActionAssociateWithVm` demo object.
+This child object exists just to act as the element of the two collections of the `XmlSnapshotParentVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm.java
new file mode 100644
index 0000000..4199e22
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm.java
@@ -0,0 +1,64 @@
+/*
+ *  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 demoapp.dom.services.xmlSnapshotService.child;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+//tag::class[]
+@XmlRootElement(name = "child")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+        nature=Nature.VIEW_MODEL,
+        objectType = "demo.XmlSnapshotChildVm"
+)
+@NoArgsConstructor
+public class XmlSnapshotChildVm implements HasAsciiDocDescription {
+
+    public XmlSnapshotChildVm(String value) {
+        setValue(value);
+    }
+
+    @Title
+    @Property()
+    @PropertyLayout()
+    @MemberOrder(name = "annotation", sequence = "1")
+    @XmlElement(required = false)
+    @Getter @Setter
+    private String value;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm.layout.xml
new file mode 100644
index 0000000..d585ea4
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/child/XmlSnapshotChildVm.layout.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- 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. -->
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd   http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+        xmlns:cpt="http://isis.apache.org/applib/layout/component"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+
+	<bs3:row>
+		<bs3:col span="10" unreferencedActions="true">
+			<cpt:domainObject />
+			<cpt:action id="returnsStandaloneList"/>
+		</bs3:col>
+		<bs3:col span="2">
+			<cpt:fieldSet name="" id="sources" />
+		</bs3:col>
+	</bs3:row>
+
+	<bs3:row>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Annotation" id="variants"/>
+			<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+		</bs3:col>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Description" id="description" >
+				<cpt:action id="clearHints" position="PANEL" />
+				<cpt:action id="downloadLayoutXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="rebuildMetamodel" position="PANEL"/>
+				<cpt:action id="downloadMetamodelXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="downloadJdoMetadata"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+				<cpt:property id="description"/>
+			</cpt:fieldSet>
+		</bs3:col>
+	</bs3:row>
+	<bs3:row>
+		<bs3:col span="12" unreferencedCollections="true"/>
+	</bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm-description.adoc
similarity index 86%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
copy to examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm-description.adoc
index f7e4277..c3eaa0f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: 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 ag [...]
 
-This child object exists just to act as the element of the two collections of the `ActionAssociateWithVm` demo object.
+This object exists just to be referenced by the `XmlSnapshotParentVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.java
new file mode 100644
index 0000000..7429bc6
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.java
@@ -0,0 +1,64 @@
+/*
+ *  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 demoapp.dom.services.xmlSnapshotService.peer.child;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+//tag::class[]
+@XmlRootElement(name = "peer")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+        nature=Nature.VIEW_MODEL,
+        objectType = "demo.XmlSnapshotPeerVm"
+)
+@NoArgsConstructor
+public class XmlSnapshotPeerVm implements HasAsciiDocDescription {
+
+    public XmlSnapshotPeerVm(String value) {
+        setValue(value);
+    }
+
+    @Title
+    @Property()
+    @PropertyLayout()
+    @MemberOrder(name = "annotation", sequence = "1")
+    @XmlElement(required = false)
+    @Getter @Setter
+    private String value;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.layout.xml
new file mode 100644
index 0000000..d585ea4
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/peer/child/XmlSnapshotPeerVm.layout.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- 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. -->
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd   http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+        xmlns:cpt="http://isis.apache.org/applib/layout/component"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+
+	<bs3:row>
+		<bs3:col span="10" unreferencedActions="true">
+			<cpt:domainObject />
+			<cpt:action id="returnsStandaloneList"/>
+		</bs3:col>
+		<bs3:col span="2">
+			<cpt:fieldSet name="" id="sources" />
+		</bs3:col>
+	</bs3:row>
+
+	<bs3:row>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Annotation" id="variants"/>
+			<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+		</bs3:col>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Description" id="description" >
+				<cpt:action id="clearHints" position="PANEL" />
+				<cpt:action id="downloadLayoutXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="rebuildMetamodel" position="PANEL"/>
+				<cpt:action id="downloadMetamodelXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="downloadJdoMetadata"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+				<cpt:property id="description"/>
+			</cpt:fieldSet>
+		</bs3:col>
+	</bs3:row>
+	<bs3:row>
+		<bs3:col span="12" unreferencedCollections="true"/>
+	</bs3:row>
+
+</bs3:grid>


[isis] 07/07: ISIS-2444: deletes unused file

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 13326ecb7f2acbad4bfc8339f6945548d487f228
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Nov 27 18:26:18 2020 +0000

    ISIS-2444: deletes unused file
---
 .../java/demoapp/dom/annotDomain/Property/mementoSerialization/.gitkeep   | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/.gitkeep
deleted file mode 100644
index e69de29..0000000


[isis] 04/07: ISIS-2444: excludes mementoSerialization for contributed properties

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit fadd804cd64dc84d58feb60948cdc16001fe299f
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Nov 26 17:01:06 2020 +0000

    ISIS-2444: excludes mementoSerialization for contributed properties
---
 .../dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java    | 3 ++-
 .../dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java        | 3 ++-
 .../services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java  | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java
index 7f00414..edcbff2 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java
@@ -22,6 +22,7 @@ import javax.inject.Inject;
 
 import org.apache.isis.applib.annotation.LabelPosition;
 import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.MementoSerialization;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Where;
@@ -32,7 +33,7 @@ import lombok.RequiredArgsConstructor;
 import demoapp.dom._infra.resources.AsciiDocReaderService;
 
 @SuppressWarnings("CdiManagedBeanInconsistencyInspection")
-@Property
+@Property(mementoSerialization = MementoSerialization.EXCLUDED)
 @RequiredArgsConstructor
 public class HasAsciiDocDescription_description {
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java
index 9c1b2f8..9aec142 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java
@@ -22,6 +22,7 @@ import javax.inject.Inject;
 
 import org.apache.isis.applib.annotation.LabelPosition;
 import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.MementoSerialization;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Where;
@@ -32,7 +33,7 @@ import lombok.val;
 
 import demoapp.dom._infra.resources.MarkupVariableResolverService;
 
-@Property
+@Property(mementoSerialization = MementoSerialization.EXCLUDED)
 @RequiredArgsConstructor @SuppressWarnings("CdiManagedBeanInconsistencyInspection")
 public class HasAsciiDocDescription_sources {
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
index 554a10f..7b8179c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/xmlSnapshotService/XmlSnapshotParentVm_takeSnapshot.java
@@ -98,7 +98,7 @@ public class XmlSnapshotParentVm_takeSnapshot {
         abstract void refine(XmlSnapshotService.Snapshot.Builder builder);
 
         private static Clob asClob(final Document document, final Demo demo) {
-            return new Clob(demo.name(), "application/xml", asChars(document));
+            return new Clob(demo.name() + ".xml", "application/xml", asChars(document));
         }
 
         @SneakyThrows


[isis] 01/07: ISIS-2468 : renames NotPersistedFacet to MementoSerializatinExcludeFacet

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit f18fc1667c1cc790f73f7a0a33723d0744df8ac8
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Nov 27 18:27:27 2020 +0000

    ISIS-2468 : renames NotPersistedFacet to MementoSerializatinExcludeFacet
---
 .../MementoSerializationExcludeFacet.java          | 15 +++---
 .../MementoSerializationExcludeFacetAbstract.java} |  8 +--
 .../propcoll/notpersisted/NotPersistedFacet.java   | 38 --------------
 .../property/PropertyAnnotationFacetFactory.java   | 36 ++++++-------
 ...lizationExcludeFacetForPropertyAnnotation.java} | 12 ++---
 .../update/NotPersistableFacetInferred.java        |  4 +-
 .../metamodel/spec/feature/ObjectAssociation.java  | 61 ++++++++--------------
 .../spec/feature/OneToOneAssociation.java          |  5 +-
 .../specimpl/ObjectAssociationAbstract.java        | 13 ++---
 .../specimpl/OneToManyAssociationDefault.java      |  1 -
 .../specimpl/OneToManyAssociationMixedIn.java      | 20 +++----
 .../core/metamodel/util/snapshot/XmlSnapshot.java  | 11 ++--
 .../PropertyMethodsFacetFactoryTest.java           | 10 ++--
 ...sistedAnnotationOnPropertyFacetFactoryTest.java | 10 ++--
 .../PropertyAnnotationFacetFactoryTest.java        | 38 +++++++-------
 .../specimpl/ObjectAssociationAbstractTest.java    | 20 -------
 ...t.java => OneToOneAssociationAbstractTest.java} | 46 +++-------------
 ...ndatoryFromJdoColumnAnnotationFacetFactory.java | 30 +++--------
 .../JdoNotPersistentAnnotationFacetFactory.java    |  6 ---
 ...JdoNotPersistentAnnotationFacetFactoryTest.java | 14 +----
 20 files changed, 128 insertions(+), 270 deletions(-)

diff --git a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/NotPersistedFacetDerivedFromJdoNotPersistentAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacet.java
similarity index 63%
rename from persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/NotPersistedFacetDerivedFromJdoNotPersistentAnnotation.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacet.java
index 68b202a..029221c 100644
--- a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/NotPersistedFacetDerivedFromJdoNotPersistentAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacet.java
@@ -16,16 +16,15 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.persistence.jdo.datanucleus5.metamodel.facets.prop.notpersistent;
 
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacetAbstract;
+package org.apache.isis.core.metamodel.facets.propcoll.memserexcl;
 
+import org.apache.isis.core.metamodel.facetapi.Facet;
 
-public class NotPersistedFacetDerivedFromJdoNotPersistentAnnotation extends NotPersistedFacetAbstract {
-
-    public NotPersistedFacetDerivedFromJdoNotPersistentAnnotation(final FacetHolder holder) {
-        super(holder);
-    }
+/**
+ * Indicates that a property should be excluded from snapshots (as per
+ * <code>XmlSnapshotService</code>.
+ */
+public interface MementoSerializationExcludeFacet extends Facet {
 
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java
similarity index 76%
rename from core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacetAbstract.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java
index 2cc2da9..a8d17dd 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java
@@ -17,19 +17,19 @@
  *  under the License.
  */
 
-package org.apache.isis.core.metamodel.facets.propcoll.notpersisted;
+package org.apache.isis.core.metamodel.facets.propcoll.memserexcl;
 
 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 NotPersistedFacetAbstract extends FacetAbstract implements NotPersistedFacet {
+public abstract class MementoSerializationExcludeFacetAbstract extends FacetAbstract implements MementoSerializationExcludeFacet {
 
     public static Class<? extends Facet> type() {
-        return NotPersistedFacet.class;
+        return MementoSerializationExcludeFacet.class;
     }
 
-    public NotPersistedFacetAbstract(final FacetHolder holder) {
+    public MementoSerializationExcludeFacetAbstract(final FacetHolder holder) {
         super(type(), holder);
     }
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacet.java
deleted file mode 100644
index 0b0099c..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/notpersisted/NotPersistedFacet.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.propcoll.notpersisted;
-
-import org.apache.isis.core.metamodel.facetapi.Facet;
-
-/**
- * Indicates that a property or a collection shouldn't be persisted.
- *
- * <p>
- * In the standard Apache Isis Programming Model, corresponds to annotating the
- * property or collection with the <tt>@NotPersisted</tt> annotation.
- *
- * <p>
- * Note that being non-persisted does not imply being disabled; see for example:
- *
- * @see http://mail-archives.apache.org/mod_mbox/incubator-isis-dev/201010.mbox/%3C4CB2FA43.7030206@nakedobjects.org%3E
- */
-public interface NotPersistedFacet extends Facet {
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java
index c3845ef..e3d445d 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java
@@ -55,7 +55,7 @@ import org.apache.isis.core.metamodel.facets.properties.property.modify.Property
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromDefault;
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.mustsatisfy.MustSatisfySpecificationFacetForPropertyAnnotation;
-import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.NotPersistedFacetForPropertyAnnotation;
+import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.MementoSerializationExcludeFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.regex.RegExFacetForPatternAnnotationOnProperty;
 import org.apache.isis.core.metamodel.facets.properties.property.regex.RegExFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
@@ -67,29 +67,29 @@ import org.apache.isis.core.metamodel.util.EventUtil;
 
 import lombok.val;
 
-public class PropertyAnnotationFacetFactory extends FacetFactoryAbstract 
+public class PropertyAnnotationFacetFactory extends FacetFactoryAbstract
 implements MetaModelRefiner {
 
-    private final MetaModelValidatorForConflictingOptionality conflictingOptionalityValidator = 
+    private final MetaModelValidatorForConflictingOptionality conflictingOptionalityValidator =
             new MetaModelValidatorForConflictingOptionality();
 
     public PropertyAnnotationFacetFactory() {
         super(FeatureType.PROPERTIES_AND_ACTIONS);
     }
-    
+
     @Override
     public void setMetaModelContext(MetaModelContext metaModelContext) {
         super.setMetaModelContext(metaModelContext);
         conflictingOptionalityValidator.setMetaModelContext(metaModelContext);
     }
-    
+
     @Override
     public void process(final ProcessMethodContext processMethodContext) {
-        
+
         val propertyIfAny = processMethodContext.synthesizeOnMethodOrMixinType(Property.class);
-        
+
         inferIntentWhenOnTypeLevel(processMethodContext, propertyIfAny);
-        
+
         processModify(processMethodContext, propertyIfAny);
         processHidden(processMethodContext, propertyIfAny);
         processEditing(processMethodContext, propertyIfAny);
@@ -112,9 +112,9 @@ implements MetaModelRefiner {
 
         //          XXX[1998] this condition would allow 'intent inference' only when @Property is found at type level
         //          val isPropertyMethodLevel = processMethodContext.synthesizeOnMethod(Property.class).isPresent();
-        //          if(isPropertyMethodLevel) return; 
+        //          if(isPropertyMethodLevel) return;
 
-        //[1998] if @Property detected on method or type level infer:    
+        //[1998] if @Property detected on method or type level infer:
         //@Action(semantics=SAFE)
         //@ActionLayout(contributed=ASSOCIATION) ... it seems, is already allowed for mixins
         val facetedMethod = processMethodContext.getFacetHolder();
@@ -218,7 +218,7 @@ implements MetaModelRefiner {
 
     void processHidden(final ProcessMethodContext processMethodContext, Optional<Property> propertyIfAny) {
         val facetHolder = processMethodContext.getFacetHolder();
-        
+
         // search for @Property(hidden=...)
         val hiddenFacet = HiddenFacetForPropertyAnnotation.create(propertyIfAny, facetHolder);
 
@@ -235,7 +235,7 @@ implements MetaModelRefiner {
     }
 
     void processCommandPublishing(
-            final ProcessMethodContext processMethodContext, 
+            final ProcessMethodContext processMethodContext,
             final Optional<Property> propertyIfAny) {
         val facetHolder = processMethodContext.getFacetHolder();
 
@@ -267,10 +267,10 @@ implements MetaModelRefiner {
     }
 
     void processExecutionPublishing(
-            final ProcessMethodContext processMethodContext, 
+            final ProcessMethodContext processMethodContext,
             final Optional<Property> propertyIfAny) {
 
-        
+
         val holder = processMethodContext.getFacetHolder();
 
         //
@@ -315,7 +315,7 @@ implements MetaModelRefiner {
         val holder = processMethodContext.getFacetHolder();
 
         // search for @Property(notPersisted=...)
-        val facet = NotPersistedFacetForPropertyAnnotation.create(propertyIfAny, holder);
+        val facet = MementoSerializationExcludeFacetForPropertyAnnotation.create(propertyIfAny, holder);
 
         super.addFacet(facet);
     }
@@ -353,12 +353,12 @@ implements MetaModelRefiner {
             super.addFacet(facet);
             return;
         }
-        
+
         // else search for @Property(pattern=...)
         val facet2 = RegExFacetForPropertyAnnotation.create(propertyIfAny, returnType, holder);
         super.addFacet(facet2);
-        
-        
+
+
     }
 
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/NotPersistedFacetForPropertyAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/MementoSerializationExcludeFacetForPropertyAnnotation.java
similarity index 71%
rename from core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/NotPersistedFacetForPropertyAnnotation.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/MementoSerializationExcludeFacetForPropertyAnnotation.java
index 27b5177..d69b5b0 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/NotPersistedFacetForPropertyAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/MementoSerializationExcludeFacetForPropertyAnnotation.java
@@ -24,23 +24,23 @@ import java.util.Optional;
 import org.apache.isis.applib.annotation.MementoSerialization;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacetAbstract;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacetAbstract;
 
-public class NotPersistedFacetForPropertyAnnotation extends NotPersistedFacetAbstract {
+public class MementoSerializationExcludeFacetForPropertyAnnotation extends MementoSerializationExcludeFacetAbstract {
 
-    public NotPersistedFacetForPropertyAnnotation(final FacetHolder holder) {
+    public MementoSerializationExcludeFacetForPropertyAnnotation(final FacetHolder holder) {
         super(holder);
     }
 
-    public static NotPersistedFacet create(
+    public static MementoSerializationExcludeFacet create(
             final Optional<Property> propertyIfAny,
             final FacetHolder holder) {
 
         return propertyIfAny
                 .map(Property::mementoSerialization)
                 .filter(mementoSerialization -> mementoSerialization == MementoSerialization.EXCLUDED)
-                .map(mementoSerialization -> new NotPersistedFacetForPropertyAnnotation(holder))
+                .map(mementoSerialization -> new MementoSerializationExcludeFacetForPropertyAnnotation(holder))
                 .orElse(null);
     }
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java
index a7942da..8846339 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java
@@ -20,9 +20,9 @@
 package org.apache.isis.core.metamodel.facets.properties.update;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacetAbstract;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacetAbstract;
 
-public class NotPersistableFacetInferred extends NotPersistedFacetAbstract {
+public class NotPersistableFacetInferred extends MementoSerializationExcludeFacetAbstract {
 
     public NotPersistableFacetInferred(final FacetHolder holder) {
         super(holder);
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
index 7ead0ab..91ed666 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectAssociation.java
@@ -44,6 +44,8 @@ import org.apache.isis.core.metamodel.spec.ManagedObject;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.util.DeweyOrderComparator;
 
+import lombok.val;
+
 /**
  * Provides reflective access to a field on a domain object.
  */
@@ -112,14 +114,6 @@ public interface ObjectAssociation extends ObjectMember, CurrentHolder {
     int getAutoCompleteMinLength();
 
     /**
-     * Returns true if calculated from other data in the object, that is, should
-     * not be persisted.
-     * @deprecated see https://issues.apache.org/jira/browse/ISIS-2468
-     */
-    @Deprecated
-    boolean isNotPersisted();
-
-    /**
      * Returns <code>true</code> if this field on the specified object is deemed
      * to be empty, or has no content.
      */
@@ -136,47 +130,36 @@ public interface ObjectAssociation extends ObjectMember, CurrentHolder {
      */
     ObjectSpecification getOnType();
 
+
     // //////////////////////////////////////////////////////
     // Predicates
     // //////////////////////////////////////////////////////
 
     @Vetoed
-    public static class Predicates {
+    class Predicates {
 
         private Predicates(){}
 
-        public static final Predicate<ObjectAssociation> PROPERTIES = new Predicate<ObjectAssociation>() {
-            @Override
-            public boolean test(final ObjectAssociation association) {
-                return association.isOneToOneAssociation();
-            }
-        };
-        public static final Predicate<ObjectAssociation> REFERENCE_PROPERTIES = new Predicate<ObjectAssociation>() {
-            @Override
-            public boolean test(final ObjectAssociation association) {
-                return association.isOneToOneAssociation() &&
-                        !association.getSpecification().containsNonFallbackFacet(ValueFacet.class);
-            }
-        };
-        public static final Predicate<ObjectAssociation> COLLECTIONS = new Predicate<ObjectAssociation>() {
-            @Override
-            public boolean test(final ObjectAssociation property) {
-                return property.isOneToManyAssociation();
-            }
-        };
+        public static final Predicate<ObjectAssociation> PROPERTIES =
+                assoc -> assoc.isOneToOneAssociation();
+
+        public static final Predicate<ObjectAssociation> REFERENCE_PROPERTIES =
+                assoc ->  assoc.isOneToOneAssociation() &&
+                         !assoc.getSpecification().containsNonFallbackFacet(ValueFacet.class);
+
+        public static final Predicate<ObjectAssociation> COLLECTIONS =
+                assoc -> assoc.isOneToManyAssociation();
 
         public static final Predicate<ObjectAssociation> staticallyVisible(final Where where) {
-            return new Predicate<ObjectAssociation>() {
-                @Override
-                public boolean test(final ObjectAssociation association) {
-                    final Stream<Facet> facets = association.streamFacets()
-                            .filter((final Facet facet)->
-                            facet instanceof WhereValueFacet && facet instanceof HiddenFacet);
-
-                    return !facets
-                            .map(facet->(WhereValueFacet) facet)
-                            .anyMatch(wawF->wawF.where().includes(where));
-                }
+            return assoc -> {
+
+                val b = assoc.streamFacets()
+                        .filter(facet ->
+                                facet instanceof WhereValueFacet &&
+                                facet instanceof HiddenFacet)
+                        .map(facet -> (WhereValueFacet) facet)
+                        .anyMatch(wawF -> wawF.where().includes(where));
+                return !b;
             };
         }
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java
index a926af5..b6861c7 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java
@@ -21,6 +21,7 @@ package org.apache.isis.core.metamodel.spec.feature;
 
 import org.apache.isis.core.metamodel.consent.Consent;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
 
 /**
@@ -54,7 +55,9 @@ public interface OneToOneAssociation extends ObjectAssociation, OneToOneFeature,
      * Returns true if calculated from other data in the object, that is, should
      * not be persisted.
      */
-    boolean isNotPersisted();
+    default boolean isNotPersisted() {
+        return containsFacet(MementoSerializationExcludeFacet.class);
+    }
 
 
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstract.java
index 4f82311..1cd629f 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstract.java
@@ -25,15 +25,14 @@ import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.FacetedMethod;
 import org.apache.isis.core.metamodel.facets.objectvalue.mandatory.MandatoryFacet;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
 import org.apache.isis.core.metamodel.facets.properties.choices.PropertyChoicesFacet;
 import org.apache.isis.core.metamodel.interactions.InteractionHead;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
 
-public abstract class ObjectAssociationAbstract 
-extends ObjectMemberAbstract 
+public abstract class ObjectAssociationAbstract
+extends ObjectMemberAbstract
 implements ObjectAssociation {
 
     private final ObjectSpecification specification;
@@ -49,11 +48,11 @@ implements ObjectAssociation {
         }
         this.specification = specification;
     }
-    
+
     protected InteractionHead headFor(final ManagedObject ownerAdapter) {
         return InteractionHead.simple(ownerAdapter);
     }
-    
+
     @Override
     public FacetHolder getFacetHolder() {
         return getFacetedMethod();
@@ -76,10 +75,6 @@ implements ObjectAssociation {
         return specification;
     }
 
-    @Override
-    public boolean isNotPersisted() {
-        return containsFacet(NotPersistedFacet.class);
-    }
 
     @Override
     public boolean hasChoices() {
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationDefault.java
index a68e06d..4c93c91 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationDefault.java
@@ -271,7 +271,6 @@ extends ObjectAssociationAbstract implements OneToManyAssociation {
         final ToString str = new ToString(this);
         str.append(super.toString());
         str.append(",");
-        str.append("persisted", !isNotPersisted());
         str.append("type", getSpecification() == null ? "unknown" : getSpecification().getShortIdentifier());
         return str.toString();
     }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java
index c9bc5b6..b42e35f 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java
@@ -33,8 +33,8 @@ import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetAbstract;
 import org.apache.isis.core.metamodel.facets.all.named.NamedFacetInferred;
 import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
 import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetForContributee;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacetAbstract;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacetAbstract;
 import org.apache.isis.core.metamodel.interactions.InteractionHead;
 import org.apache.isis.core.metamodel.services.publishing.ExecutionPublisher;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
@@ -75,13 +75,13 @@ public class OneToManyAssociationMixedIn extends OneToManyAssociationDefault imp
             final ObjectActionDefault objectAction) {
 
         val actionTypeOfFacet = objectAction.getFacet(TypeOfFacet.class);
-        // TODO: a bit of a hack; ought really to set up a fallback TypeOfFacetDefault, 
-        // which ensures that there is always a TypeOfFacet for any mixedIn associations 
+        // TODO: a bit of a hack; ought really to set up a fallback TypeOfFacetDefault,
+        // which ensures that there is always a TypeOfFacet for any mixedIn associations
         // created from mixin actions.
-        val type = actionTypeOfFacet != null
+        Class<?> type = actionTypeOfFacet != null
                 ? actionTypeOfFacet.value()
                 : (Class<?>)Object.class;
-                
+
         return objectAction.getSpecificationLoader().loadSpecification(type);
     }
 
@@ -100,11 +100,11 @@ public class OneToManyAssociationMixedIn extends OneToManyAssociationDefault imp
         //
         // ensure the mixedIn collection cannot be modified, and derive its TypeOfFaccet
         //
-        final NotPersistedFacet notPersistedFacet = new NotPersistedFacetAbstract(this) {};
+        final MementoSerializationExcludeFacet mementoSerializationExcludeFacet = new MementoSerializationExcludeFacetAbstract(this) {};
         final DisabledFacet disabledFacet = disabledFacet();
         final TypeOfFacet typeOfFacet = new TypeOfFacetAbstract(getSpecification().getCorrespondingClass(), this) {};
 
-        FacetUtil.addFacet(notPersistedFacet);
+        FacetUtil.addFacet(mementoSerializationExcludeFacet);
         FacetUtil.addFacet(disabledFacet);
         FacetUtil.addFacet(typeOfFacet);
 
@@ -131,7 +131,7 @@ public class OneToManyAssociationMixedIn extends OneToManyAssociationDefault imp
 
         identifier = Identifier.actionIdentifier(mixedInType.getCorrespondingClass().getName(), getId(), memberParameterNames);
     }
-    
+
     @Override
     protected InteractionHead headFor(final ManagedObject mixedInAdapter) {
         val mixinAdapter = mixinAdapterFor(mixinType, mixedInAdapter);
@@ -152,7 +152,7 @@ public class OneToManyAssociationMixedIn extends OneToManyAssociationDefault imp
     public ManagedObject get(
             final ManagedObject ownerAdapter,
             final InteractionInitiatedBy interactionInitiatedBy) {
-        
+
         return getPublishingServiceInternal().withPublishingSuppressed(
                 () -> mixinAction.executeInternal(
                         headFor(ownerAdapter), Can.empty(), interactionInitiatedBy));
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java
index adf1a40..6c72124 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java
@@ -210,12 +210,7 @@ public class XmlSnapshot implements Snapshot {
 
         final String fullyQualifiedClassName = object.getSpecification().getFullIdentifier();
 
-        schema.setUri(fullyQualifiedClassName); // derive
-        // URI
-        // from
-        // fully
-        // qualified
-        // name
+        schema.setUri(fullyQualifiedClassName); // derive URI from fully qualified name
 
         final Place place = objectToElement(object);
 
@@ -501,6 +496,10 @@ public class XmlSnapshot implements Snapshot {
             }
 
             final OneToOneAssociation oneToOneAssociation = ((OneToOneAssociation) field);
+
+            if(oneToOneAssociation.isNotPersisted()) {
+                return false;
+            }
             final ManagedObject referencedObject = oneToOneAssociation.get(fieldPlace.getObject(),
                     InteractionInitiatedBy.FRAMEWORK);
 
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
index 0c4fd38..dda3e8d 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
@@ -35,7 +35,7 @@ import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContex
 import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
 import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessor;
 import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessorFactory;
 import org.apache.isis.core.metamodel.facets.properties.autocomplete.PropertyAutoCompleteFacet;
@@ -175,8 +175,8 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
 
         facetFactory.process(new FacetFactory.ProcessMethodContext(Customer.class, null, propertyAccessorMethod, methodRemover, facetedMethod));
 
-        assertNull(facetedMethod.getFacet(NotPersistedFacet.class));
-        assertNull(facetedMethod.getFacet(NotPersistedFacet.class));
+        assertNull(facetedMethod.getFacet(MementoSerializationExcludeFacet.class));
+        assertNull(facetedMethod.getFacet(MementoSerializationExcludeFacet.class));
     }
 
     public void testSetterFacetIsInstalledForModifyMethodAndMethodRemoved() {
@@ -239,7 +239,7 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
         facetFactoryForModify.process(processMethodContext);
         disabledFacetOnPropertyInferredFactory.process(processMethodContext);
 
-        Facet facet = facetedMethod.getFacet(NotPersistedFacet.class);
+        Facet facet = facetedMethod.getFacet(MementoSerializationExcludeFacet.class);
         assertNotNull(facet);
         assertTrue(facet instanceof NotPersistableFacetInferred);
 
@@ -618,7 +618,7 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
         val facetFactory = new PropertyAccessorFacetViaAccessorFactory();
         val facetFactoryForHide = new HideForContextFacetViaMethodFactory();
         val facetFactoryForDisable = new DisableForContextFacetViaMethodFactory();
-        
+
         facetFactory.setMetaModelContext(super.metaModelContext);
         facetFactoryForHide.setMetaModelContext(super.metaModelContext);
         facetFactoryForDisable.setMetaModelContext(super.metaModelContext);
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java
index e00cdfa..d38495d 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java
@@ -26,8 +26,8 @@ import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
-import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.NotPersistedFacetForPropertyAnnotation;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.MementoSerializationExcludeFacetForPropertyAnnotation;
 
 import lombok.val;
 
@@ -46,7 +46,7 @@ public class NotPersistedAnnotationOnPropertyFacetFactoryTest extends AbstractFa
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processNotPersisted(processMethodContext, propertyIfAny);
     }
-    
+
     public void testAnnotationPickedUpOnProperty() {
 
         class Customer {
@@ -60,9 +60,9 @@ public class NotPersistedAnnotationOnPropertyFacetFactoryTest extends AbstractFa
 
         processNotPersisted(facetFactory, new FacetFactory.ProcessMethodContext(Customer.class, null, method, methodRemover, facetedMethod));
 
-        final Facet facet = facetedMethod.getFacet(NotPersistedFacet.class);
+        final Facet facet = facetedMethod.getFacet(MementoSerializationExcludeFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof NotPersistedFacetForPropertyAnnotation);
+        assertTrue(facet instanceof MementoSerializationExcludeFacetForPropertyAnnotation);
 
         assertNoMethodsRemoved();
     }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java
index 8c3a66e..8a636e1 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java
@@ -54,7 +54,7 @@ import org.apache.isis.core.metamodel.facets.objectvalue.maxlen.MaxLengthFacet;
 import org.apache.isis.core.metamodel.facets.objectvalue.mustsatisfyspec.MustSatisfySpecificationFacet;
 import org.apache.isis.core.metamodel.facets.objectvalue.regex.RegExFacet;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacetAbstract;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
 import org.apache.isis.core.metamodel.facets.properties.property.disabled.DisabledFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.hidden.HiddenFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.mandatory.MandatoryFacetForPropertyAnnotation;
@@ -67,7 +67,7 @@ import org.apache.isis.core.metamodel.facets.properties.property.modify.Property
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromDefault;
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.mustsatisfy.MustSatisfySpecificationFacetForPropertyAnnotation;
-import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.NotPersistedFacetForPropertyAnnotation;
+import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.MementoSerializationExcludeFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.regex.RegExFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacetAbstract;
@@ -109,56 +109,56 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
 
         }});
     }
-    
+
     private static void processModify(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processModify(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processHidden(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processHidden(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processOptional(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processOptional(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processRegEx(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processRegEx(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processEditing(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processEditing(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processMaxLength(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processMaxLength(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processMustSatisfy(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processMustSatisfy(processMethodContext, propertyIfAny);
     }
-    
+
     private static void processNotPersisted(
             PropertyAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val propertyIfAny = processMethodContext.synthesizeOnMethod(Property.class);
         facetFactory.processNotPersisted(processMethodContext, propertyIfAny);
     }
-    
-    
+
+
 
     @Before
     public void setUp() throws Exception {
@@ -202,7 +202,7 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
             FacetUtil.addFacet(new PropertyClearFacetAbstract(holder) {
                 @Override
                 public ManagedObject clearProperty(
-                        final OneToOneAssociation owningProperty, 
+                        final OneToOneAssociation owningProperty,
                         final ManagedObject targetAdapter,
                         final InteractionInitiatedBy interactionInitiatedBy) {
                     return targetAdapter;
@@ -231,7 +231,7 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
             // expect
             allowingLoadSpecificationRequestsFor(cls, propertyMethod.getReturnType());
             context.checking(new Expectations() {{
-                //[ahuber] never called during this test ...             	
+                //[ahuber] never called during this test ...
                 //oneOf(mockConfiguration).getBoolean("isis.core.meta-model.annotation.property.domain-event.post-for-default", true);
                 //will(returnValue(true));
 
@@ -453,7 +453,7 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
         }
 
     }
-   
+
 
     public static class Editing extends PropertyAnnotationFacetFactoryTest {
 
@@ -595,9 +595,9 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
             processNotPersisted(facetFactory, processMethodContext);
 
             // then
-            final NotPersistedFacet notPersistedFacet = facetedMethod.getFacet(NotPersistedFacet.class);
-            Assert.assertNotNull(notPersistedFacet);
-            Assert.assertTrue(notPersistedFacet instanceof NotPersistedFacetForPropertyAnnotation);
+            final MementoSerializationExcludeFacet mementoSerializationExcludeFacet = facetedMethod.getFacet(MementoSerializationExcludeFacet.class);
+            Assert.assertNotNull(mementoSerializationExcludeFacet);
+            Assert.assertTrue(mementoSerializationExcludeFacet instanceof MementoSerializationExcludeFacetForPropertyAnnotation);
         }
 
     }
@@ -806,4 +806,4 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
 
     }
 
-}
\ No newline at end of file
+}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java
index d29f57e..2f08b70 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java
@@ -38,7 +38,6 @@ import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.FacetedMethod;
 import org.apache.isis.core.metamodel.facets.objectvalue.mandatory.MandatoryFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
 import org.apache.isis.core.metamodel.facets.properties.choices.PropertyChoicesFacet;
 import org.apache.isis.core.metamodel.interactions.UsabilityContext;
 import org.apache.isis.core.metamodel.interactions.VisibilityContext;
@@ -150,25 +149,6 @@ public class ObjectAssociationAbstractTest {
     }
 
     @Test
-    public void notPersistedWhenDerived() throws Exception {
-        final NotPersistedFacet mockFacet = mockFacetIgnoring(NotPersistedFacet.class);
-        facetedMethod.addFacet(mockFacet);
-        assertTrue(objectAssociation.isNotPersisted());
-    }
-
-    @Test
-    public void notPersistedWhenFlaggedAsNotPersisted() throws Exception {
-        final NotPersistedFacet mockFacet = mockFacetIgnoring(NotPersistedFacet.class);
-        facetedMethod.addFacet(mockFacet);
-        assertTrue(objectAssociation.isNotPersisted());
-    }
-
-    @Test
-    public void persisted() throws Exception {
-        assertFalse(objectAssociation.isNotPersisted());
-    }
-
-    @Test
     public void notHidden() throws Exception {
         assertFalse(objectAssociation.isAlwaysHidden());
     }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java
similarity index 78%
copy from core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java
copy to core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java
index d29f57e..d22993d 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectAssociationAbstractTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java
@@ -35,18 +35,16 @@ import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2;
 import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2.Mode;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.FacetedMethod;
-import org.apache.isis.core.metamodel.facets.objectvalue.mandatory.MandatoryFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
-import org.apache.isis.core.metamodel.facets.properties.choices.PropertyChoicesFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
 import org.apache.isis.core.metamodel.interactions.UsabilityContext;
 import org.apache.isis.core.metamodel.interactions.VisibilityContext;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 
-public class ObjectAssociationAbstractTest {
+public class OneToOneAssociationAbstractTest {
 
     @Rule
     public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
@@ -55,7 +53,7 @@ public class ObjectAssociationAbstractTest {
     @Mock private ServiceInjector mockServicesInjector;
     @Mock private SpecificationLoader mockSpecificationLoader;
 
-    private ObjectAssociationAbstract objectAssociation;
+    private OneToOneAssociation objectAssociation;
     private FacetedMethod facetedMethod;
 
 
@@ -78,8 +76,7 @@ public class ObjectAssociationAbstractTest {
             //            will(returnValue(mockPersistenceSessionServiceInternal));
         }});
 
-        objectAssociation = new ObjectAssociationAbstract(
-                facetedMethod, FeatureType.PROPERTY, objectSpecification) {
+        objectAssociation = new OneToOneAssociationDefault(facetedMethod, objectSpecification) {
 
             @Override
             public ManagedObject get(
@@ -151,14 +148,14 @@ public class ObjectAssociationAbstractTest {
 
     @Test
     public void notPersistedWhenDerived() throws Exception {
-        final NotPersistedFacet mockFacet = mockFacetIgnoring(NotPersistedFacet.class);
+        final MementoSerializationExcludeFacet mockFacet = mockFacetIgnoring(MementoSerializationExcludeFacet.class);
         facetedMethod.addFacet(mockFacet);
         assertTrue(objectAssociation.isNotPersisted());
     }
 
     @Test
     public void notPersistedWhenFlaggedAsNotPersisted() throws Exception {
-        final NotPersistedFacet mockFacet = mockFacetIgnoring(NotPersistedFacet.class);
+        final MementoSerializationExcludeFacet mockFacet = mockFacetIgnoring(MementoSerializationExcludeFacet.class);
         facetedMethod.addFacet(mockFacet);
         assertTrue(objectAssociation.isNotPersisted());
     }
@@ -168,35 +165,6 @@ public class ObjectAssociationAbstractTest {
         assertFalse(objectAssociation.isNotPersisted());
     }
 
-    @Test
-    public void notHidden() throws Exception {
-        assertFalse(objectAssociation.isAlwaysHidden());
-    }
-
-    @Test
-    public void optional() throws Exception {
-        assertFalse(objectAssociation.isMandatory());
-    }
-
-    @Test
-    public void mandatory() throws Exception {
-        final MandatoryFacet mockFacet = mockFacetIgnoring(MandatoryFacet.class);
-        facetedMethod.addFacet(mockFacet);
-        assertTrue(objectAssociation.isMandatory());
-    }
-
-    @Test
-    public void hasNoChoices() throws Exception {
-        assertFalse(objectAssociation.hasChoices());
-    }
-
-    @Test
-    public void hasChoices() throws Exception {
-        final PropertyChoicesFacet mockFacet = mockFacetIgnoring(PropertyChoicesFacet.class);
-        facetedMethod.addFacet(mockFacet);
-        assertTrue(objectAssociation.hasChoices());
-    }
-
     private <T extends Facet> T mockFacetIgnoring(final Class<T> typeToMock) {
         final T facet = context.mock(typeToMock);
         context.checking(new Expectations() {
diff --git a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java
index f0a7984..c98b0bc 100644
--- a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java
+++ b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/column/MandatoryFromJdoColumnAnnotationFacetFactory.java
@@ -47,7 +47,7 @@ import org.apache.isis.persistence.jdo.datanucleus5.metamodel.facets.prop.primar
 import lombok.val;
 
 
-public class MandatoryFromJdoColumnAnnotationFacetFactory extends FacetFactoryAbstract 
+public class MandatoryFromJdoColumnAnnotationFacetFactory extends FacetFactoryAbstract
 implements MetaModelRefiner {
 
     public MandatoryFromJdoColumnAnnotationFacetFactory() {
@@ -106,13 +106,13 @@ implements MetaModelRefiner {
 
         if(_Strings.isNotEmpty(allowsNull)) {
             // if miss-spelled, then DN assumes is not-nullable
-            return !"true".equalsIgnoreCase(allowsNull.trim()); 
+            return !"true".equalsIgnoreCase(allowsNull.trim());
         }
-        
+
         final Class<?> returnType = processMethodContext.getMethod().getReturnType();
         // per JDO spec
         return returnType != null && returnType.isPrimitive();
-        
+
     }
 
     @Override
@@ -156,15 +156,6 @@ implements MetaModelRefiner {
 
                 if(facet instanceof MandatoryFacetDerivedFromJdoColumn) {
 
-                    if(association.isNotPersisted()) {
-                        validator.onFailure(
-                                association,
-                                association.getIdentifier(),
-                                "%s: @javax.jdo.annotations.Column found on non-persisted property; please remove)",
-                                association.getIdentifier().toClassAndNameIdentityString());
-                        return;
-                    }
-
                     if(underlying.isInvertedSemantics() == facet.isInvertedSemantics()) {
                         return;
                     }
@@ -174,24 +165,19 @@ implements MetaModelRefiner {
                         validator.onFailure(
                                 association,
                                 association.getIdentifier(),
-                                "%s: incompatible usage of Isis' @Optional annotation and @javax.jdo.annotations.Column; use just @javax.jdo.annotations.Column(allowsNull=\"...\")", 
+                                "%s: incompatible usage of Isis' @Optional annotation and @javax.jdo.annotations.Column; use just @javax.jdo.annotations.Column(allowsNull=\"...\")",
                                 association.getIdentifier().toClassAndNameIdentityString());
                     } else {
                         validator.onFailure(
                                 association,
                                 association.getIdentifier(),
-                                "%s: incompatible Isis' default of required/optional properties vs JDO; add @javax.jdo.annotations.Column(allowsNull=\"...\")", 
+                                "%s: incompatible Isis' default of required/optional properties vs JDO; add @javax.jdo.annotations.Column(allowsNull=\"...\")",
                                 association.getIdentifier().toClassAndNameIdentityString());
                     }
                 }
 
                 if(facet instanceof MandatoryFacetInferredFromAbsenceOfJdoColumn) {
 
-                    if(association.isNotPersisted()) {
-                        // nothing to do.
-                        return;
-                    }
-
                     if(underlying.isInvertedSemantics() == facet.isInvertedSemantics()) {
                         return;
                     }
@@ -200,13 +186,13 @@ implements MetaModelRefiner {
                         validator.onFailure(
                                 association,
                                 association.getIdentifier(),
-                                "%s: incompatible usage of Isis' @Optional annotation and @javax.jdo.annotations.Column; use just @javax.jdo.annotations.Column(allowsNull=\"...\")", 
+                                "%s: incompatible usage of Isis' @Optional annotation and @javax.jdo.annotations.Column; use just @javax.jdo.annotations.Column(allowsNull=\"...\")",
                                 association.getIdentifier().toClassAndNameIdentityString());
                     } else {
                         validator.onFailure(
                                 association,
                                 association.getIdentifier(),
-                                "%s: incompatible default handling of required/optional properties between Isis and JDO; add @javax.jdo.annotations.Column(allowsNull=\"...\")", 
+                                "%s: incompatible default handling of required/optional properties between Isis and JDO; add @javax.jdo.annotations.Column(allowsNull=\"...\")",
                                 association.getIdentifier().toClassAndNameIdentityString());
                     }
                 }
diff --git a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/JdoNotPersistentAnnotationFacetFactory.java b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/JdoNotPersistentAnnotationFacetFactory.java
index d1aacde..9cd8e25 100644
--- a/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/JdoNotPersistentAnnotationFacetFactory.java
+++ b/persistence/jdo/datanucleus-5/src/main/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/JdoNotPersistentAnnotationFacetFactory.java
@@ -41,14 +41,9 @@ public class JdoNotPersistentAnnotationFacetFactory extends FacetFactoryAbstract
         if(!JdoMetamodelUtil.isPersistenceEnhanced(cls)) {
             return;
         }
-        
-        //val method = processMethodContext.getMethod();
 
         final NotPersistent annotation = processMethodContext.synthesizeOnMethod(NotPersistent.class)
                 .orElse(null);
-                
-//        _Assert.assertEquals("expected same", annotation,
-//                Annotations.getAnnotation(method, NotPersistent.class));
 
         if (annotation == null) {
             return;
@@ -56,6 +51,5 @@ public class JdoNotPersistentAnnotationFacetFactory extends FacetFactoryAbstract
 
         final FacetedMethod holder = processMethodContext.getFacetHolder();
         FacetUtil.addFacet(new JdoNotPersistentFacetAnnotation(holder));
-        FacetUtil.addFacet(new NotPersistedFacetDerivedFromJdoNotPersistentAnnotation(holder));
     }
 }
diff --git a/persistence/jdo/datanucleus-5/src/test/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/GivenJdoNotPersistentAnnotationFacetFactoryTest.java b/persistence/jdo/datanucleus-5/src/test/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/GivenJdoNotPersistentAnnotationFacetFactoryTest.java
index 6f5f4df..36d0ca3 100644
--- a/persistence/jdo/datanucleus-5/src/test/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/GivenJdoNotPersistentAnnotationFacetFactoryTest.java
+++ b/persistence/jdo/datanucleus-5/src/test/java/org/apache/isis/persistence/jdo/datanucleus5/metamodel/facets/prop/notpersistent/GivenJdoNotPersistentAnnotationFacetFactoryTest.java
@@ -25,12 +25,12 @@ import javax.jdo.annotations.NotPersistent;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.propcoll.notpersisted.NotPersistedFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
 import org.apache.isis.persistence.jdo.datanucleus5.testing.AbstractFacetFactoryTest;
 
 import lombok.val;
 
-public class GivenJdoNotPersistentAnnotationFacetFactoryTest 
+public class GivenJdoNotPersistentAnnotationFacetFactoryTest
 extends AbstractFacetFactoryTest {
 
     private JdoNotPersistentAnnotationFacetFactory facetFactory;
@@ -67,16 +67,6 @@ extends AbstractFacetFactoryTest {
         assertTrue(facet instanceof JdoNotPersistentFacet);
     }
 
-    public void testNotPersistedDerived() throws Exception {
-        final Class<?> cls = SimpleObjectWithNotPersistentColumn.class;
-        final Method method = cls.getMethod("getSomeColumn");
-        facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, method, methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(NotPersistedFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof NotPersistedFacetDerivedFromJdoNotPersistentAnnotation);
-    }
-
     public void testIfNoIdAnnotationThenNoFacet() throws Exception {
 
         class Customer {


[isis] 02/07: ISIS-2468: completes renaming of NotPersistedFacet

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit bbeec0fe84de6cc7bbab5ab9310edcd78381cc30
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Nov 28 12:42:38 2020 +0000

    ISIS-2468: completes renaming of NotPersistedFacet
---
 .../changetracking/EntityChangeTrackerDefault.java | 58 +++++++++++-----------
 1 file changed, 30 insertions(+), 28 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/changetracking/EntityChangeTrackerDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/changetracking/EntityChangeTrackerDefault.java
index 1654699..732d850 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/changetracking/EntityChangeTrackerDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/changetracking/EntityChangeTrackerDefault.java
@@ -69,6 +69,7 @@ import org.apache.isis.core.metamodel.spec.ManagedObject;
 import org.apache.isis.core.metamodel.spec.ManagedObjects.EntityUtil;
 import org.apache.isis.core.metamodel.spec.feature.MixedIn;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
 import org.apache.isis.core.runtime.persistence.transaction.IsisTransactionPlaceholder;
 
 import lombok.AccessLevel;
@@ -85,25 +86,25 @@ import lombok.extern.log4j.Log4j2;
 @Qualifier("Default")
 @IsisInteractionScope
 @Log4j2
-public class EntityChangeTrackerDefault 
-implements 
+public class EntityChangeTrackerDefault
+implements
     TransactionScopeListener,
     MetricsService,
     EntityChangeTracker,
-    HasEnlistedEntityPropertyChanges, 
+    HasEnlistedEntityPropertyChanges,
     HasEnlistedEntityChanges {
 
     // end::refguide[]
-    
+
     @Inject private EntityPropertyChangePublisher entityPropertyChangePublisher;
     @Inject private EntityChangesPublisher entityChangesPublisher;
     @Inject private EventBusService eventBusService;
     @Inject private Provider<InteractionContext> interactionContextProvider;
-    
+
     /**
      * Used for auditing: this contains the pre- values of every property of every object enlisted.
      * <p>
-     * When {@link #getEntityAuditEntries()} is called, then this is cleared out and 
+     * When {@link #getEntityAuditEntries()} is called, then this is cleared out and
      * {@link #changedObjectProperties} is non-null, containing the actual differences.
      */
     // tag::refguide[]
@@ -151,7 +152,7 @@ implements
     }
 
     private Set<PropertyChangeRecord> getPropertyChangeRecords() {
-        // this code path has side-effects, it locks the result for this transaction, 
+        // this code path has side-effects, it locks the result for this transaction,
         // such that cannot enlist on top of it
         return changedObjectPropertiesRef.get();
     }
@@ -164,11 +165,11 @@ implements
         }
 
         entityChangeEventCount.increment();
-        
+
         if(!EntityChangePublishingFacet.isPublishingEnabled(adapter.getSpecification())) {
             return false; // ignore entities that are not enabled for entity change publishing
         }
-        
+
         return true;
     }
 
@@ -198,11 +199,11 @@ implements
             break;
         }
     }
-    
+
     private void prepareCommandPublishing() {
         val command = currentInteraction().getCommand();
         command.updater().setSystemStateChanged(
-                command.isSystemStateChanged() 
+                command.isSystemStateChanged()
                 || entityChangeEventCount.longValue() > 0L);
     }
 
@@ -212,11 +213,11 @@ implements
             final String userName) {
         return ChangingEntitiesFactory.createChangingEntities(timestamp, userName, this);
     }
-    
+
     Interaction currentInteraction() {
         return interactionContextProvider.get().getInteractionElseFail();
     }
-    
+
     // -- HELPER
 
     static String asString(Object object) {
@@ -227,9 +228,9 @@ implements
      * @return <code>true</code> if successfully enlisted, <code>false</code> if was already enlisted
      */
     private boolean enlistForChangeKindAuditing(
-            final @NonNull ManagedObject entity, 
+            final @NonNull ManagedObject entity,
             final @NonNull EntityChangeKind changeKind) {
-        
+
         val previousChangeKind = changeKindByEnlistedAdapter.get(entity);
         if(previousChangeKind == null) {
             changeKindByEnlistedAdapter.put(entity, changeKind);
@@ -262,7 +263,7 @@ implements
     }
 
     private void enlistForPreAndPostValueAuditing(
-            final ManagedObject entity, 
+            final ManagedObject entity,
             final Function<AdapterAndProperty, PreAndPostValues> pre) {
 
         log.debug("enlist entity's property changes for auditing {}", entity);
@@ -270,6 +271,7 @@ implements
         entity.getSpecification()
         .streamAssociations(MixedIn.EXCLUDED)
         .filter(ObjectAssociation.Predicates.PROPERTIES)
+        .map(OneToOneAssociation.class::cast)
         .filter(property->!property.isNotPersisted())
         .map(property->AdapterAndProperty.of(entity, property))
         .filter(aap->!enlistedEntityPropertiesForAuditing.containsKey(aap)) // already enlisted, so ignore
@@ -278,8 +280,8 @@ implements
         });
     }
 
-    /** 
-     * For any enlisted Object Properties collects those, that are meant for auditing, 
+    /**
+     * For any enlisted Object Properties collects those, that are meant for auditing,
      * then clears enlisted objects.
      */
     private Set<PropertyChangeRecord> capturePostValuesAndDrain() {
@@ -308,19 +310,19 @@ implements
             preAndPostValues.setPost(adapterAndProperty.getPropertyValue());
         }
     }
-    
+
     // -- METRICS SERVICE
-    
+
     @Override
     public int numberEntitiesLoaded() {
         return Math.toIntExact(numberEntitiesLoaded.longValue());
     }
-    
+
     @Override
     public int numberEntitiesDirtied() {
         return changeKindByEnlistedAdapter.size();
     }
-    
+
     int numberAuditedEntityPropertiesModified() {
         return getPropertyChangeRecords().size();
     }
@@ -362,24 +364,24 @@ implements
     @Override
     public void recognizeLoaded(ManagedObject entity) {
         CallbackFacet.Util.callCallback(entity, LoadedCallbackFacet.class);
-        postLifecycleEventIfRequired(entity, LoadedLifecycleEventFacet.class);        
+        postLifecycleEventIfRequired(entity, LoadedLifecycleEventFacet.class);
     }
 
     @Override
     public void recognizePersisting(ManagedObject entity) {
         CallbackFacet.Util.callCallback(entity, PersistingCallbackFacet.class);
-        postLifecycleEventIfRequired(entity, PersistingLifecycleEventFacet.class);        
+        postLifecycleEventIfRequired(entity, PersistingLifecycleEventFacet.class);
     }
-    
+
     @Override
     public void recognizeUpdating(ManagedObject entity) {
         CallbackFacet.Util.callCallback(entity, UpdatedCallbackFacet.class);
         postLifecycleEventIfRequired(entity, UpdatedLifecycleEventFacet.class);
     }
-    
+
     private final LongAdder numberEntitiesLoaded = new LongAdder();
     private final LongAdder entityChangeEventCount = new LongAdder();
-    
+
     @Override
     public void incrementLoaded() {
         numberEntitiesLoaded.increment();
@@ -415,7 +417,7 @@ implements
             final java.sql.Timestamp timestamp,
             final String userName,
             final TransactionId txId) {
-        
+
         return getPropertyChangeRecords().stream()
         .map(propertyChangeRecord->EntityPropertyChangeFactory
                 .createEntityPropertyChange(timestamp, userName, txId, propertyChangeRecord));