You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/05/27 11:00:51 UTC

[isis] branch master updated: ISIS-2513: Demo: add JPA support for PropertyCommandPublishing

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2bddb71  ISIS-2513: Demo: add JPA support for PropertyCommandPublishing
2bddb71 is described below

commit 2bddb71410e46f045d55d4973252dd642b47cc02
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu May 27 13:00:35 2021 +0200

    ISIS-2513: Demo: add JPA support for PropertyCommandPublishing
---
 .../src/main/java/demoapp/dom/DemoModuleJpa.java   |  2 +
 ...ngePublishingEnabledMetaAnnotOverriddenJdo.java |  3 +-
 .../domain/properties/Property/PropertyMenu.java   | 10 ++--
 .../PropertyCommandPublishingEntity.java           | 53 +++++++++++++++++++
 ... => PropertyCommandPublishingEntity.layout.xml} |  0
 .../PropertyCommandPublishingJdoSeedService.java   | 57 --------------------
 ....java => PropertyCommandPublishingSeeding.java} | 31 +++--------
 .../PropertyCommandPublishingJdo-description.adoc  | 16 +++---
 .../{ => jdo}/PropertyCommandPublishingJdo.java    | 29 +++++-----
 .../PropertyCommandPublishingJdoEntities.java      | 34 ++++--------
 .../PropertyCommandPublishingJpa-description.adoc} | 24 ++++-----
 .../PropertyCommandPublishingJpa.java}             | 61 +++++++++++++---------
 .../PropertyCommandPublishingJpaEntities.java}     | 34 ++++--------
 13 files changed, 164 insertions(+), 190 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
index 36762b1..e4564f3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
@@ -28,6 +28,7 @@ import org.apache.isis.persistence.jpa.eclipselink.IsisModuleJpaEclipselink;
 
 import demoapp.dom.domain.actions.Action.commandPublishing.jpa.ActionCommandPublishingJpa;
 import demoapp.dom.domain.actions.Action.executionPublishing.jpa.ActionExecutionPublishingJpa;
+import demoapp.dom.domain.properties.Property.commandPublishing.jpa.PropertyCommandPublishingJpa;
 import demoapp.dom.services.core.wrapperFactory.jpa.WrapperFactoryJpa;
 import demoapp.dom.services.extensions.secman.apptenancy.jpa.TenantedJpa;
 import demoapp.dom.types.isis.blobs.jpa.IsisBlobJpa;
@@ -125,6 +126,7 @@ import demoapp.dom.types.primitive.shorts.jpa.PrimitiveShortJpa;
 
         ActionCommandPublishingJpa.class,
         ActionExecutionPublishingJpa.class,
+        PropertyCommandPublishingJpa.class,
 
 })
 public class DemoModuleJpa {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/entityChangePublishing/metaAnnotOverridden/enabled/DomainObjectEntityChangePublishingEnabledMetaAnnotOverriddenJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/entityChangePublishing/metaAnnotOverridden/enabled/DomainObjectEntityChangePublishingEnabledMetaAnnotOverriddenJdo.java
index ad7e35f..3729e11 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/entityChangePublishing/metaAnnotOverridden/enabled/DomainObjectEntityChangePublishingEnabledMetaAnnotOverriddenJdo.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/entityChangePublishing/metaAnnotOverridden/enabled/DomainObjectEntityChangePublishingEnabledMetaAnnotOverriddenJdo.java
@@ -51,7 +51,8 @@ import demoapp.dom.domain.objects.DomainObject.entityChangePublishing.metaAnnotO
         "@DomainObjectAuditingDisabledMetaAnnotation " +
         "@DomainObject(publishing=ENABLED)"
 )
-public class DomainObjectEntityChangePublishingEnabledMetaAnnotOverriddenJdo implements DomainObjectEntityChangePublishingJdo {
+public class DomainObjectEntityChangePublishingEnabledMetaAnnotOverriddenJdo
+        implements DomainObjectEntityChangePublishingJdo {
     // ...
 //end::class[]
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/PropertyMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/PropertyMenu.java
index 759ebb9..ca42fbb 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/PropertyMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/PropertyMenu.java
@@ -33,8 +33,8 @@ import org.apache.isis.applib.value.Clob;
 import lombok.RequiredArgsConstructor;
 import lombok.val;
 
-import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingJdo;
-import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingEntity;
 import demoapp.dom.domain.properties.Property.domainEvent.PropertyDomainEventVm;
 import demoapp.dom.domain.properties.Property.editing.PropertyEditingVm;
 import demoapp.dom.domain.properties.Property.executionPublishing.PropertyExecutionPublishingJdo;
@@ -57,7 +57,7 @@ import demoapp.dom.types.Samples;
 @RequiredArgsConstructor(onConstructor_ = {@Inject})
 public class PropertyMenu {
 
-    final PropertyCommandPublishingJdoEntities propertyCommandJdoEntities;
+    final ValueHolderRepository<String, ? extends PropertyCommandPublishingEntity> propertyCommandEntities;
     final PropertyProjectingChildJdoEntities propertyProjectingChildJdoEntities;
     final PropertyExecutionPublishingJdoEntities propertyPublishingJdoEntities;
     final Samples<Blob> blobSamples;
@@ -65,8 +65,8 @@ public class PropertyMenu {
 
     @Action(semantics = SemanticsOf.SAFE)
     @ActionLayout(cssClassFa="fa-terminal", describedAs = "Action invocation intentions as XML")
-    public PropertyCommandPublishingJdo commandPublishing(){
-        return propertyCommandJdoEntities.first();
+    public PropertyCommandPublishingEntity commandPublishing(){
+        return propertyCommandEntities.first().orElse(null);
     }
 
     @Action(semantics = SemanticsOf.SAFE)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingEntity.java
new file mode 100644
index 0000000..80a17f8
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingEntity.java
@@ -0,0 +1,53 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.properties.Property.commandPublishing;
+
+import org.apache.isis.applib.annotation.DomainObject;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom._infra.values.ValueHolder;
+import demoapp.dom.domain._commands.ExposePersistedCommands;
+
+@DomainObject(
+        logicalTypeName = "demo.PropertyCommandPublishingEntity" // shared permissions with concrete sub class
+)
+public abstract class PropertyCommandPublishingEntity
+implements
+    HasAsciiDocDescription,
+    ExposePersistedCommands,
+    ValueHolder<String> {
+
+    @Override
+    public String value() {
+        return getProperty();
+    }
+
+    protected abstract String getProperty();
+    protected abstract void setProperty(String value);
+
+    protected abstract String getPropertyCommandPublishingDisabled();
+    protected abstract void setPropertyCommandPublishingDisabled(String value);
+
+    protected abstract String getPropertyMetaAnnotated();
+    protected abstract void setPropertyMetaAnnotated(String value);
+
+    protected abstract String getPropertyMetaAnnotatedOverridden();
+    protected abstract void setPropertyMetaAnnotatedOverridden(String value);
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingEntity.layout.xml
similarity index 100%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.layout.xml
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingEntity.layout.xml
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoSeedService.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoSeedService.java
deleted file mode 100644
index 446df40..0000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoSeedService.java
+++ /dev/null
@@ -1,57 +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 demoapp.dom.domain.properties.Property.commandPublishing;
-
-import javax.inject.Inject;
-
-import org.springframework.stereotype.Service;
-
-import org.apache.isis.applib.services.repository.RepositoryService;
-import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScript;
-
-import demoapp.dom._infra.seed.SeedServiceAbstract;
-import demoapp.dom.types.Samples;
-
-@Service
-public class PropertyCommandPublishingJdoSeedService extends SeedServiceAbstract {
-
-    public PropertyCommandPublishingJdoSeedService() {
-        super(PropertyPublishingJdoEntityFixture::new);
-    }
-
-    static class PropertyPublishingJdoEntityFixture extends FixtureScript {
-
-        @Override
-        protected void execute(ExecutionContext executionContext) {
-            samples.stream()
-                    .map(PropertyCommandPublishingJdo::new)
-                    .forEach(domainObject -> {
-                        repositoryService.persist(domainObject);
-                        executionContext.addResult(this, domainObject);
-                    });
-
-        }
-
-        @Inject
-        RepositoryService repositoryService;
-
-        @Inject
-        Samples<String> samples;
-    }
-}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingSeeding.java
similarity index 55%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingSeeding.java
index 6b815a6..d182b91 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingSeeding.java
@@ -18,35 +18,20 @@
  */
 package demoapp.dom.domain.properties.Property.commandPublishing;
 
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-
 import javax.inject.Inject;
 
 import org.springframework.stereotype.Service;
 
-import org.apache.isis.applib.services.repository.RepositoryService;
-
-import lombok.RequiredArgsConstructor;
+import demoapp.dom._infra.seed.SeedServiceAbstract;
+import demoapp.dom._infra.values.ValueHolderRepository;
 
 @Service
-@RequiredArgsConstructor(onConstructor_ = { @Inject })
-public class PropertyCommandPublishingJdoEntities {
-
-    final RepositoryService repositoryService;
-
-    public Optional<PropertyCommandPublishingJdo> find(final String value) {
-        return repositoryService.firstMatch(PropertyCommandPublishingJdo.class, x -> Objects.equals(x.getProperty(), value));
-    }
-
-    public List<PropertyCommandPublishingJdo> all() {
-        return repositoryService.allInstances(PropertyCommandPublishingJdo.class);
-    }
+public class PropertyCommandPublishingSeeding
+extends SeedServiceAbstract {
 
-    public PropertyCommandPublishingJdo first() {
-        return all().stream().findFirst().get();
+    @Inject
+    public PropertyCommandPublishingSeeding(ValueHolderRepository<String, ? extends PropertyCommandPublishingEntity> entities) {
+        super(entities);
     }
 
-
-}
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdo-description.adoc
similarity index 89%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo-description.adoc
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdo-description.adoc
index 7e89069..a334239 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdo-description.adoc
@@ -1,11 +1,9 @@
 :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 [...]
 
-WARNING: TODO command was renamed to commandPublishing
+The `commandPublishing` element is used to allow or suppress the reification of a property edit into a xref:refguide:applib:index/services/command/Command.adoc[Command].
 
-The `command` element is used to allow or suppress the reification of an property edit into a xref:refguide:applib:index/services/command/Command.adoc[Command].
 
-
-When allowed (the default), then the xref:refguide:applib:index/services/command/Command.adoc[Command] is sent to registered implementation(s) of https://isis.apache.org/refguide/2.0.0-M3/applib-svc/CommandServiceListener.html#section-top[CommandServiceListener] SPI, _after_ the interaction has completed.
+When allowed (the default), then the xref:refguide:applib:index/services/command/Command.adoc[Command] is sent to registered implementation(s) of https://isis.apache.org/refguide/2.0.0-M5/applib-svc/CommandSubscriber.html#section-top[CommandSubscriber] SPI, _after_ the interaction has completed.
 One use case is to replicate and replay commands to a secondary system, for example for regression testing.
 For more on this, see the "Command Replay" section below.
 
@@ -21,7 +19,7 @@ If running in prototype mode, the list of persisted xref:refguide:applib:index/s
 
 == Annotated
 
-The `command` element can be specified explicitly using an annotation through `@Property#command()`:
+The `commandPublishing` element can be specified explicitly using an annotation through `@Property#commandPublishing()`:
 
 [source,java,indent=0]
 ----
@@ -29,7 +27,7 @@ include::PropertyCommandPublishingJdo.java[tags=annotation]
 ----
 <.> explicitly specifies that invoking the action should be reified .
 
-The command reification can also be disabled:
+The command publishing can also be disabled:
 
 [source,java,indent=0]
 ----
@@ -40,13 +38,13 @@ include::PropertyCommandPublishingJdo.java[tags=annotation-2]
 
 == Meta-annotated
 
-The `command` element can also be specified using a custom meta-annotation:
+The `commandPublishing` element can also be specified using a custom meta-annotation:
 
 * the meta-annotation is defined as:
 +
 [source,java,indent=0]
 ----
-include::PropertyCommandPublishingEnabledMetaAnnotation.java[tags=class]
+include::../PropertyCommandPublishingEnabledMetaAnnotation.java[tags=class]
 ----
 <.> annotated for a property
 <.> annotation can be applied to a property field or getter method
@@ -73,7 +71,7 @@ include::PropertyCommandPublishingJdo.java[tags=meta-annotation-overridden]
 
 
 
-== CommandServiceListener
+== CommandSubscriber
 
 The demo includes the link:https://isis.apache.org/extensions/2.0.0-M3/command-log/about.html[Command Log] extension, so every command is persisted.
 These can be viewed in the collection at the bottom of the left page.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdo.java
similarity index 78%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.java
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdo.java
index b742fff..9a1f6b0 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdo.java
@@ -16,13 +16,15 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.domain.properties.Property.commandPublishing;
+package demoapp.dom.domain.properties.Property.commandPublishing.jdo;
 
 import javax.jdo.annotations.DatastoreIdentity;
 import javax.jdo.annotations.IdGeneratorStrategy;
 import javax.jdo.annotations.IdentityType;
 import javax.jdo.annotations.PersistenceCapable;
 
+import org.springframework.context.annotation.Profile;
+
 import org.apache.isis.applib.annotation.DomainObject;
 import org.apache.isis.applib.annotation.Editing;
 import org.apache.isis.applib.annotation.Nature;
@@ -30,33 +32,36 @@ import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Publishing;
 
-import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.domain._commands.ExposePersistedCommands;
 import lombok.Getter;
 import lombok.Setter;
 
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingDisabledMetaAnnotation;
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingEnabledMetaAnnotation;
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingEntity;
+
+@Profile("demo-jdo")
 //tag::class[]
 @PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
 @DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
 @DomainObject(
         nature=Nature.ENTITY
-        , logicalTypeName = "demo.PropertyCommandJdo"
+        , logicalTypeName = "demo.PropertyCommandPublishingEntity"
         , editing = Editing.ENABLED
 )
 public class PropertyCommandPublishingJdo
-        implements HasAsciiDocDescription, ExposePersistedCommands {
+        extends PropertyCommandPublishingEntity {
     // ...
 //end::class[]
 
     public PropertyCommandPublishingJdo(String initialValue) {
         this.property = initialValue;
-        this.propertyCommandDispatchDisabled = initialValue;
+        this.propertyCommandPublishingDisabled = initialValue;
         this.propertyMetaAnnotated = initialValue;
         this.propertyMetaAnnotatedOverridden = initialValue;
     }
 
     public String title() {
-        return "Property#command";
+        return "Property#commandPublishing (JDO)";
     }
 
 //tag::annotation[]
@@ -64,7 +69,7 @@ public class PropertyCommandPublishingJdo
         commandPublishing = Publishing.ENABLED                  // <.>
     )
     @PropertyLayout(
-        describedAs = "@Property(command = ENABLED)",
+        describedAs = "@Property(commandPublishing = ENABLED)",
         fieldSetId = "annotation", sequence = "1")
     @Getter @Setter
     private String property;
@@ -75,10 +80,10 @@ public class PropertyCommandPublishingJdo
         commandPublishing = Publishing.DISABLED                 // <.>
     )
     @PropertyLayout(
-        describedAs = "@Property(command = DISABLED)",
+        describedAs = "@Property(commandPublishing = DISABLED)",
         fieldSetId = "annotation", sequence = "2")
     @Getter @Setter
-    private String propertyCommandDispatchDisabled;
+    private String propertyCommandPublishingDisabled;
 //end::annotation-2[]
 
 //tag::meta-annotation[]
@@ -92,11 +97,11 @@ public class PropertyCommandPublishingJdo
 
 //tag::meta-annotation-overridden[]
     @PropertyCommandPublishingDisabledMetaAnnotation              // <.>
-    @Property(commandPublishing = Publishing.ENABLED)           // <.>
+    @Property(commandPublishing = Publishing.ENABLED)             // <.>
     @PropertyLayout(
         describedAs =
             "@PropertyCommandDisabledMetaAnnotation " +
-            "@Property(command = ENABLED)",
+            "@Property(commandPublishing = ENABLED)",
             fieldSetId = "meta-annotated-overridden", sequence = "1")
     @Getter @Setter
     private String propertyMetaAnnotatedOverridden;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdoEntities.java
similarity index 54%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdoEntities.java
index 6b815a6..1e22357 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jdo/PropertyCommandPublishingJdoEntities.java
@@ -16,37 +16,25 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.domain.properties.Property.commandPublishing;
-
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-
-import javax.inject.Inject;
+package demoapp.dom.domain.properties.Property.commandPublishing.jdo;
 
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Service;
 
-import org.apache.isis.applib.services.repository.RepositoryService;
-
-import lombok.RequiredArgsConstructor;
+import demoapp.dom._infra.values.ValueHolderRepository;
 
+@Profile("demo-jdo")
 @Service
-@RequiredArgsConstructor(onConstructor_ = { @Inject })
-public class PropertyCommandPublishingJdoEntities {
-
-    final RepositoryService repositoryService;
+public class PropertyCommandPublishingJdoEntities
+extends ValueHolderRepository<String, PropertyCommandPublishingJdo> {
 
-    public Optional<PropertyCommandPublishingJdo> find(final String value) {
-        return repositoryService.firstMatch(PropertyCommandPublishingJdo.class, x -> Objects.equals(x.getProperty(), value));
+    protected PropertyCommandPublishingJdoEntities() {
+        super(PropertyCommandPublishingJdo.class);
     }
 
-    public List<PropertyCommandPublishingJdo> all() {
-        return repositoryService.allInstances(PropertyCommandPublishingJdo.class);
+    @Override
+    protected PropertyCommandPublishingJdo newDetachedEntity(String value) {
+        return new PropertyCommandPublishingJdo(value);
     }
 
-    public PropertyCommandPublishingJdo first() {
-        return all().stream().findFirst().get();
-    }
-
-
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpa-description.adoc
similarity index 85%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo-description.adoc
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpa-description.adoc
index 7e89069..c3cdfa8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpa-description.adoc
@@ -1,11 +1,9 @@
 :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 [...]
 
-WARNING: TODO command was renamed to commandPublishing
+The `commandPublishing` element is used to allow or suppress the reification of a property edit into a xref:refguide:applib:index/services/command/Command.adoc[Command].
 
-The `command` element is used to allow or suppress the reification of an property edit into a xref:refguide:applib:index/services/command/Command.adoc[Command].
 
-
-When allowed (the default), then the xref:refguide:applib:index/services/command/Command.adoc[Command] is sent to registered implementation(s) of https://isis.apache.org/refguide/2.0.0-M3/applib-svc/CommandServiceListener.html#section-top[CommandServiceListener] SPI, _after_ the interaction has completed.
+When allowed (the default), then the xref:refguide:applib:index/services/command/Command.adoc[Command] is sent to registered implementation(s) of https://isis.apache.org/refguide/2.0.0-M5/applib-svc/CommandSubscriber.html#section-top[CommandSubscriber] SPI, _after_ the interaction has completed.
 One use case is to replicate and replay commands to a secondary system, for example for regression testing.
 For more on this, see the "Command Replay" section below.
 
@@ -21,32 +19,32 @@ If running in prototype mode, the list of persisted xref:refguide:applib:index/s
 
 == Annotated
 
-The `command` element can be specified explicitly using an annotation through `@Property#command()`:
+The `commandPublishing` element can be specified explicitly using an annotation through `@Property#commandPublishing()`:
 
 [source,java,indent=0]
 ----
-include::PropertyCommandPublishingJdo.java[tags=annotation]
+include::PropertyCommandPublishingJpa.java[tags=annotation]
 ----
 <.> explicitly specifies that invoking the action should be reified .
 
-The command reification can also be disabled:
+The command publishing can also be disabled:
 
 [source,java,indent=0]
 ----
-include::PropertyCommandPublishingJdo.java[tags=annotation-2]
+include::PropertyCommandPublishingJpa.java[tags=annotation-2]
 ----
 <.> explicitly specifies that invoking the action should not be reified.
 
 
 == Meta-annotated
 
-The `command` element can also be specified using a custom meta-annotation:
+The `commandPublishing` element can also be specified using a custom meta-annotation:
 
 * the meta-annotation is defined as:
 +
 [source,java,indent=0]
 ----
-include::PropertyCommandPublishingEnabledMetaAnnotation.java[tags=class]
+include::../PropertyCommandPublishingEnabledMetaAnnotation.java[tags=class]
 ----
 <.> annotated for a property
 <.> annotation can be applied to a property field or getter method
@@ -55,7 +53,7 @@ include::PropertyCommandPublishingEnabledMetaAnnotation.java[tags=class]
 +
 [source,java,indent=0]
 ----
-include::PropertyCommandPublishingJdo.java[tags=meta-annotation]
+include::PropertyCommandPublishingJpa.java[tags=meta-annotation]
 ----
 <.> semantic is inherited from the meta-annotation
 
@@ -66,14 +64,14 @@ The meta-annotation can itself be overridden:
 
 [source,java,indent=0]
 ----
-include::PropertyCommandPublishingJdo.java[tags=meta-annotation-overridden]
+include::PropertyCommandPublishingJpa.java[tags=meta-annotation-overridden]
 ----
 <.> semantic from meta-annotation ...
 <.> \... is overridden by the `@Property` annotation
 
 
 
-== CommandServiceListener
+== CommandSubscriber
 
 The demo includes the link:https://isis.apache.org/extensions/2.0.0-M3/command-log/about.html[Command Log] extension, so every command is persisted.
 These can be viewed in the collection at the bottom of the left page.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpa.java
similarity index 64%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpa.java
index b742fff..b5977f5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdo.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpa.java
@@ -16,55 +16,68 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.domain.properties.Property.commandPublishing;
+package demoapp.dom.domain.properties.Property.commandPublishing.jpa;
 
-import javax.jdo.annotations.DatastoreIdentity;
-import javax.jdo.annotations.IdGeneratorStrategy;
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.PersistenceCapable;
+import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.springframework.context.annotation.Profile;
 
 import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.Editing;
-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.Publishing;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
 
-import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.domain._commands.ExposePersistedCommands;
 import lombok.Getter;
+import lombok.NoArgsConstructor;
 import lombok.Setter;
 
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingDisabledMetaAnnotation;
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingEnabledMetaAnnotation;
+import demoapp.dom.domain.properties.Property.commandPublishing.PropertyCommandPublishingEntity;
+
+@Profile("demo-jpa")
 //tag::class[]
-@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
-@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
+@Entity
+@Table(
+schema = "demo",
+name = "PropertyCommandPublishingJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
 @DomainObject(
-        nature=Nature.ENTITY
-        , logicalTypeName = "demo.PropertyCommandJdo"
-        , editing = Editing.ENABLED
+logicalTypeName = "demo.PropertyCommandPublishingEntity"
 )
-public class PropertyCommandPublishingJdo
-        implements HasAsciiDocDescription, ExposePersistedCommands {
+@NoArgsConstructor
+public class PropertyCommandPublishingJpa
+        extends PropertyCommandPublishingEntity {
     // ...
 //end::class[]
 
-    public PropertyCommandPublishingJdo(String initialValue) {
+    public PropertyCommandPublishingJpa(String initialValue) {
         this.property = initialValue;
-        this.propertyCommandDispatchDisabled = initialValue;
+        this.propertyCommandPublishingDisabled = initialValue;
         this.propertyMetaAnnotated = initialValue;
         this.propertyMetaAnnotatedOverridden = initialValue;
     }
 
     public String title() {
-        return "Property#command";
+        return "Property#commandPublishing (JPA)";
     }
 
+    @Id
+    @GeneratedValue
+    private Long id;
+
 //tag::annotation[]
     @Property(
         commandPublishing = Publishing.ENABLED                  // <.>
     )
     @PropertyLayout(
-        describedAs = "@Property(command = ENABLED)",
+        describedAs = "@Property(commandPublishing = ENABLED)",
         fieldSetId = "annotation", sequence = "1")
     @Getter @Setter
     private String property;
@@ -75,10 +88,10 @@ public class PropertyCommandPublishingJdo
         commandPublishing = Publishing.DISABLED                 // <.>
     )
     @PropertyLayout(
-        describedAs = "@Property(command = DISABLED)",
+        describedAs = "@Property(commandPublishing = DISABLED)",
         fieldSetId = "annotation", sequence = "2")
     @Getter @Setter
-    private String propertyCommandDispatchDisabled;
+    private String propertyCommandPublishingDisabled;
 //end::annotation-2[]
 
 //tag::meta-annotation[]
@@ -92,11 +105,11 @@ public class PropertyCommandPublishingJdo
 
 //tag::meta-annotation-overridden[]
     @PropertyCommandPublishingDisabledMetaAnnotation              // <.>
-    @Property(commandPublishing = Publishing.ENABLED)           // <.>
+    @Property(commandPublishing = Publishing.ENABLED)             // <.>
     @PropertyLayout(
         describedAs =
             "@PropertyCommandDisabledMetaAnnotation " +
-            "@Property(command = ENABLED)",
+            "@Property(commandPublishing = ENABLED)",
             fieldSetId = "meta-annotated-overridden", sequence = "1")
     @Getter @Setter
     private String propertyMetaAnnotatedOverridden;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpaEntities.java
similarity index 54%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpaEntities.java
index 6b815a6..eefb719 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/PropertyCommandPublishingJdoEntities.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/properties/Property/commandPublishing/jpa/PropertyCommandPublishingJpaEntities.java
@@ -16,37 +16,25 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.domain.properties.Property.commandPublishing;
-
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-
-import javax.inject.Inject;
+package demoapp.dom.domain.properties.Property.commandPublishing.jpa;
 
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Service;
 
-import org.apache.isis.applib.services.repository.RepositoryService;
-
-import lombok.RequiredArgsConstructor;
+import demoapp.dom._infra.values.ValueHolderRepository;
 
+@Profile("demo-jpa")
 @Service
-@RequiredArgsConstructor(onConstructor_ = { @Inject })
-public class PropertyCommandPublishingJdoEntities {
-
-    final RepositoryService repositoryService;
+public class PropertyCommandPublishingJpaEntities
+extends ValueHolderRepository<String, PropertyCommandPublishingJpa> {
 
-    public Optional<PropertyCommandPublishingJdo> find(final String value) {
-        return repositoryService.firstMatch(PropertyCommandPublishingJdo.class, x -> Objects.equals(x.getProperty(), value));
+    protected PropertyCommandPublishingJpaEntities() {
+        super(PropertyCommandPublishingJpa.class);
     }
 
-    public List<PropertyCommandPublishingJdo> all() {
-        return repositoryService.allInstances(PropertyCommandPublishingJdo.class);
+    @Override
+    protected PropertyCommandPublishingJpa newDetachedEntity(String value) {
+        return new PropertyCommandPublishingJpa(value);
     }
 
-    public PropertyCommandPublishingJdo first() {
-        return all().stream().findFirst().get();
-    }
-
-
 }