You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/03/27 22:25:50 UTC

[causeway] branch master updated: CAUSEWAY-2485: adds @DomainObject#editing

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/causeway.git


The following commit(s) were added to refs/heads/master by this push:
     new 18fea18798 CAUSEWAY-2485: adds @DomainObject#editing
18fea18798 is described below

commit 18fea187987883bb69230181ffd07a0e22215e93
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Mar 27 23:25:27 2023 +0100

    CAUSEWAY-2485: adds @DomainObject#editing
---
 .../src/main/java/demoapp/dom/DemoModuleJpa.java   |  2 +
 .../DomainObject/editing/DomainObjectEditing.java  | 51 ++++++++++++++
 ...m.layout.xml => DomainObjectEditing.layout.xml} | 46 ++++++++++--
 .../editing/DomainObjectEditingSeeding.java        | 38 ++++++++++
 .../editing/DomainObjectEditingVm-description.adoc | 37 ++++++++--
 .../editing/DomainObjectEditingVm.layout.xml       |  5 ++
 .../editing/DomainObjectEditingVm_objects.java     | 31 +++++++++
 .../DomainObjectEditingJpa-description.adoc}       | 22 +++---
 .../editing/jpa/DomainObjectEditingJpa.java        | 81 ++++++++++++++++++++++
 .../jpa/DomainObjectEditingJpaEntities.java        | 40 +++++++++++
 10 files changed, 326 insertions(+), 27 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 cd47ca03b2..b0e66514c1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
@@ -31,6 +31,7 @@ import demoapp.dom.domain.actions.Action.executionPublishing.jpa.ActionExecution
 import demoapp.dom.domain.objects.DomainObject.aliased.jpa.DomainObjectAliasedJpa;
 import demoapp.dom.domain.objects.DomainObject.autoComplete.jpa.DomainObjectAutoCompleteJpa;
 import demoapp.dom.domain.objects.DomainObject.bounded.jpa.DomainObjectBoundingJpa;
+import demoapp.dom.domain.objects.DomainObject.editing.jpa.DomainObjectEditingJpa;
 import demoapp.dom.domain.objects.DomainObject.entityChangePublishing.annotated.disabled.jpa.DomainObjectEntityChangePublishingDisabledJpa;
 import demoapp.dom.domain.objects.DomainObject.entityChangePublishing.annotated.enabled.jpa.DomainObjectEntityChangePublishingEnabledJpa;
 import demoapp.dom.domain.objects.DomainObject.entityChangePublishing.metaAnnot.enabled.jpa.DomainObjectEntityChangePublishingEnabledMetaAnnotatedJpa;
@@ -97,6 +98,7 @@ import demoapp.dom.types.primitive.shorts.jpa.PrimitiveShortJpa;
         DomainObjectAliasedJpa.class,
         DomainObjectAutoCompleteJpa.class,
         DomainObjectBoundingJpa.class,
+        DomainObjectEditingJpa.class,
 
         CausewayBlobJpa.class,
         CausewayClobJpa.class,
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditing.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditing.java
new file mode 100644
index 0000000000..2aeae26e1c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditing.java
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.objects.DomainObject.editing;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom._infra.values.ValueHolder;
+
+import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.Property;
+import org.apache.causeway.applib.annotation.PropertyLayout;
+
+@SuppressWarnings("CdiManagedBeanInconsistencyInspection")
+public abstract class DomainObjectEditing
+        implements
+        HasAsciiDocDescription,
+        ValueHolder<String> {
+
+    public String title() {
+        return value();
+    }
+
+    @Override
+    public String value() {
+        return getName();
+    }
+
+    public abstract String getName();
+    public abstract void setName(String value);
+
+    @Property(editing = Editing.DISABLED, editingDisabledReason = "This property cannot be edited")
+    public abstract String getOriginalName();
+    public abstract void setOriginalName(String value);
+
+    public abstract Character getInitialCharacter();
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditing.layout.xml
similarity index 61%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditing.layout.xml
index b4f853de75..691a0c6d47 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditing.layout.xml
@@ -26,22 +26,54 @@
 
 	<bs3:row>
 		<bs3:col span="6">
-			<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+			<bs3:tabGroup>
+				<bs3:tab name="General">
+					<bs3:row>
+						<bs3:col span="12">
+							<cpt:fieldSet name="General" id="general" >
+								<cpt:property id="name"/>
+								<cpt:property id="originalName"/>
+								<cpt:property id="initialCharacter"/>
+							</cpt:fieldSet>
+						</bs3:col>
+					</bs3:row>
+				</bs3:tab>
+				<bs3:tab name="Metadata">
+					<bs3:row>
+						<bs3:col span="12">
+							<cpt:fieldSet name="Metadata" id="metadata" >
+								<cpt:property id="id"/>
+								<cpt:property id="logicalTypeName"/>
+								<cpt:property id="version"/>
+							</cpt:fieldSet>
+						</bs3:col>
+					</bs3:row>
+				</bs3:tab>
+				<bs3:tab name="Other">
+					<bs3:row>
+						<bs3:col span="12">
+							<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+						</bs3:col>
+					</bs3:row>
+				</bs3:tab>
+			</bs3:tabGroup>
 		</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="downloadLayout"  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="downloadMetamodelXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="downloadJdoMetamodel"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="recentAuditTrailEntries"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="impersonateWithRoles"  position="PANEL_DROPDOWN"/>
 				<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
 				<cpt:property id="description"/>
 			</cpt:fieldSet>
-		</bs3:col>
-	</bs3:row>
+		</bs3:col>	</bs3:row>
 	<bs3:row>
 		<bs3:col span="12" unreferencedCollections="true"/>
 	</bs3:row>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingSeeding.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingSeeding.java
new file mode 100644
index 0000000000..c827597ecd
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingSeeding.java
@@ -0,0 +1,38 @@
+/*
+ *  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.objects.DomainObject.editing;
+
+import demoapp.dom._infra.seed.SeedServiceAbstract;
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+import javax.inject.Inject;
+
+import org.springframework.stereotype.Service;
+
+@Service
+public class DomainObjectEditingSeeding
+extends SeedServiceAbstract {
+
+    @Inject
+    public DomainObjectEditingSeeding(
+            ValueHolderRepository<String, ? extends DomainObjectEditing> entities) {
+        super(entities);
+    }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc
index 81290cc623..59396d9809 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc
@@ -1,15 +1,38 @@
 :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 `editing` attribute ...
+The state of the application can be changed either by invoking actions on domain objects, or by directly editing their properties.
 
-WARNING: TODO[CAUSEWAY-3312]
-Whether the properties of this domain object can be edited, or collections of this object be added to/removed from.
-Note that non-editable objects can nevertheless have actions invoked upon them.
+If the application has complicated business logic, then it's usually preferable to make all changes using actions, with editing globally disabled using a configuration property:
 
-The `editingDisabledReason` attribute ...
+[source,yaml]
+.application.yml
+----
+causeway:
+  applib:
+    annotation:
+      domain-object:
+        editing: false
+----
 
-WARNING: TODO[CAUSEWAY-3312]
-If #editing() is set to Editing#DISABLED , then the reason to provide to the user as to why the object’s properties cannot be edited/collections modified.
+This demo application is configured in this way.
 
+The link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/DomainObject.html#editing[@DomainObject#editing] annotation can be used to override the default for a specific object, so that all of its properties can be edited.
+It's also possible to override the class-level default on a per-property basis, using the link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Property.html#editing[@Property#editing] attribute.
 
+There are therefore three levels at which property editing can be defined:
+
+    @Property > @DomainObject > global configuration property
+
+Alternatively, this works in the opposite direction also: if the global config property is to _allow_ properties to be edited, then the link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/DomainObject.html#editing[@DomainObject#editing] can be used to disable editing and link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Property.html#editing[@Property#editing].
+
+In addition, the link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/DomainObject.html#editingDisabledReason[@DomainObject#editingDisabledReason] can be used to specify the reason why a property cannot be edited.
+This can also be specified at the property level using link:https://causeway.apache.org/refguide/2.0.0-RC1/applib/index/annotation/Property.html#editingDisabledReason[@Property#editingDisabledReason].
+
+=== How this demo works
+
+The collection on the left shows a set of entity instances, which use `@DomainObject#editing` to enable editing of their properties.
+However, `@Property#editing` is then used to disable the "originalName" property.
+The "initialCharacter" property cannot be edited either, because it is a derived property (has only a getter).
+
+Navigate through to the entity in order to edit its properties, and to see the corresponding source code.
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml
index b4f853de75..319686dee1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm.layout.xml
@@ -27,6 +27,9 @@
 	<bs3:row>
 		<bs3:col span="6">
 			<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+			<cpt:collection id="objects">
+				<cpt:action id="find"/>
+			</cpt:collection>
 		</bs3:col>
 		<bs3:col span="6">
 			<cpt:fieldSet name="Description" id="description" >
@@ -36,6 +39,8 @@
 				<cpt:action id="downloadMetamodelXml"  position="PANEL_DROPDOWN"/>
 				<cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
                 <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentExecutions"  position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentAuditTrailEntries"  position="PANEL_DROPDOWN"/>
 				<cpt:action id="downloadJdoMetadata"  position="PANEL_DROPDOWN"/>
 				<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
 				<cpt:property id="description"/>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm_objects.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm_objects.java
new file mode 100644
index 0000000000..ac662bdfa3
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm_objects.java
@@ -0,0 +1,31 @@
+package demoapp.dom.domain.objects.DomainObject.editing;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.domain.objects.DomainObject.bounded.DomainObjectBoundingVm;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.causeway.applib.annotation.Collection;
+import org.apache.causeway.applib.annotation.CollectionLayout;
+import org.apache.causeway.applib.annotation.MemberSupport;
+
+@Collection()
+@CollectionLayout()
+@RequiredArgsConstructor
+public class DomainObjectEditingVm_objects {
+
+    @SuppressWarnings("unused")
+    private final DomainObjectEditingVm mixee;
+
+    @MemberSupport
+    public List<? extends DomainObjectEditing> coll() {
+        return objectRepository.all();
+    }
+
+    @Inject
+    ValueHolderRepository<String, ? extends DomainObjectEditing> objectRepository;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpa-description.adoc
similarity index 60%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpa-description.adoc
index 81290cc623..022c59a5c7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/DomainObjectEditingVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpa-description.adoc
@@ -1,15 +1,11 @@
 :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 `editing` attribute ...
-
-WARNING: TODO[CAUSEWAY-3312]
-Whether the properties of this domain object can be edited, or collections of this object be added to/removed from.
-Note that non-editable objects can nevertheless have actions invoked upon them.
-
-The `editingDisabledReason` attribute ...
-
-WARNING: TODO[CAUSEWAY-3312]
-If #editing() is set to Editing#DISABLED , then the reason to provide to the user as to why the object’s properties cannot be edited/collections modified.
-
-
-
+[source,java,indent=0]
+.DomainObjectEditingJpa.java
+----
+include::DomainObjectEditingJpa.java[tags=class]
+----
+<.> indicates that the properties of this type may be edited, overriding the global default set by  configuration property.
+<.> editable property because of the `@DomainObject#editing` annotation
+<.> this property cannot, after all, be edited, with `@Property#editing` overriding `@DomainObject#editing`
+<.> also a non-editable property, but this time because it is a derived property.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpa.java
new file mode 100644
index 0000000000..4734977dcc
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpa.java
@@ -0,0 +1,81 @@
+/*
+ *  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.objects.DomainObject.editing.jpa;
+
+import demoapp.dom.domain.objects.DomainObject.editing.DomainObjectEditing;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import javax.inject.Named;
+import javax.persistence.*;
+
+import org.apache.causeway.applib.annotation.Bounding;
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.Property;
+import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener;
+import org.springframework.context.annotation.Profile;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+    schema = "demo",
+    name = "DomainObjectEditingJpa"
+)
+@EntityListeners(CausewayEntityListener.class)
+@Named("demo.DomainObjectEditing")
+@DomainObject(
+        editing = Editing.ENABLED               // <.>
+)
+@NoArgsConstructor
+public class DomainObjectEditingJpa extends DomainObjectEditing {
+    // ...
+//end::class[]
+
+    public DomainObjectEditingJpa(String value) {
+        setName(value);
+        setOriginalName(value);
+    }
+
+    @Id
+    @GeneratedValue
+    private Long id;
+//tag::class[]
+
+    @Getter @Setter
+    private String name;                        // <.>
+
+    @Property(
+            editing = Editing.DISABLED,         // <.>
+            editingDisabledReason = "This property may not be edited"
+    )
+    @Getter @Setter
+    private String originalName;
+
+    public Character getInitialCharacter() {    // <.>
+        return getName().charAt(0);
+    }
+//end::class[]
+
+
+//tag::class[]
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpaEntities.java
new file mode 100644
index 0000000000..33a7739ece
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/editing/jpa/DomainObjectEditingJpaEntities.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.domain.objects.DomainObject.editing.jpa;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+@Profile("demo-jpa")
+@Service
+public class DomainObjectEditingJpaEntities
+extends ValueHolderRepository<String, DomainObjectEditingJpa> {
+
+    protected DomainObjectEditingJpaEntities() {
+        super(DomainObjectEditingJpa.class);
+    }
+
+    @Override
+    protected DomainObjectEditingJpa newDetachedEntity(String value) {
+        return new DomainObjectEditingJpa(value);
+    }
+
+}