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/20 10:36:27 UTC

[isis] branch master updated: ISIS-2620: Demo: create primitive value entities for JPA

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 363c3c0  ISIS-2620: Demo: create primitive value entities for JPA
363c3c0 is described below

commit 363c3c0548f712a7a0c4fc4d7741350ba2f7c902
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu May 20 12:36:14 2021 +0200

    ISIS-2620: Demo: create primitive value entities for JPA
---
 .../src/main/java/demoapp/dom/DemoModuleJpa.java   | 18 +++++
 .../primitive/booleans/PrimitiveBooleans.java      | 12 ++--
 .../jpa/PrimitiveBooleanJpa-description.adoc       | 18 +++++
 .../booleans/jpa/PrimitiveBooleanJpa.java          | 79 ++++++++++++++++++++++
 .../booleans/jpa/PrimitiveBooleanJpaEntities.java  | 40 +++++++++++
 .../dom/types/primitive/bytes/PrimitiveBytes.java  | 12 ++--
 .../bytes/jpa/PrimitiveByteJpa-description.adoc    | 18 +++++
 .../primitive/bytes/jpa/PrimitiveByteJpa.java      | 79 ++++++++++++++++++++++
 .../bytes/jpa/PrimitiveByteJpaEntities.java        | 40 +++++++++++
 .../dom/types/primitive/chars/PrimitiveChars.java  | 12 ++--
 .../chars/jpa/PrimitiveCharJpa-description.adoc    | 18 +++++
 .../primitive/chars/jpa/PrimitiveCharJpa.java      | 79 ++++++++++++++++++++++
 .../chars/jpa/PrimitiveCharJpaEntities.java        | 40 +++++++++++
 .../types/primitive/doubles/PrimitiveDoubles.java  | 12 ++--
 .../jpa/PrimitiveDoubleJpa-description.adoc        | 19 ++++++
 .../primitive/doubles/jpa/PrimitiveDoubleJpa.java  | 79 ++++++++++++++++++++++
 .../doubles/jpa/PrimitiveDoubleJpaEntities.java    | 40 +++++++++++
 .../types/primitive/floats/PrimitiveFloats.java    | 12 ++--
 .../floats/jpa/PrimitiveFloatJpa-description.adoc  | 19 ++++++
 .../primitive/floats/jpa/PrimitiveFloatJpa.java    | 79 ++++++++++++++++++++++
 .../floats/jpa/PrimitiveFloatJpaEntities.java      | 40 +++++++++++
 .../dom/types/primitive/ints/PrimitiveInts.java    | 12 ++--
 .../ints/jpa/PrimitiveIntJpa-description.adoc      | 19 ++++++
 .../types/primitive/ints/jpa/PrimitiveIntJpa.java  | 79 ++++++++++++++++++++++
 .../ints/jpa/PrimitiveIntJpaEntities.java          | 40 +++++++++++
 .../dom/types/primitive/longs/PrimitiveLongs.java  | 12 ++--
 .../longs/jpa/PrimitiveLongJpa-description.adoc    | 19 ++++++
 .../primitive/longs/jpa/PrimitiveLongJpa.java      | 79 ++++++++++++++++++++++
 .../longs/jpa/PrimitiveLongJpaEntities.java        | 40 +++++++++++
 .../types/primitive/shorts/PrimitiveShorts.java    | 12 ++--
 .../shorts/jpa/PrimitiveShortJpa-description.adoc  | 19 ++++++
 .../primitive/shorts/jpa/PrimitiveShortJpa.java    | 79 ++++++++++++++++++++++
 .../shorts/jpa/PrimitiveShortJpaEntities.java      | 40 +++++++++++
 33 files changed, 1159 insertions(+), 56 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 8667168..b182353 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
@@ -35,6 +35,14 @@ import demoapp.dom.types.javalang.integers.jpa.WrapperIntegerJpa;
 import demoapp.dom.types.javalang.longs.jpa.WrapperLongJpa;
 import demoapp.dom.types.javalang.shorts.jpa.WrapperShortJpa;
 import demoapp.dom.types.javalang.strings.jpa.JavaLangStringJpa;
+import demoapp.dom.types.primitive.booleans.jpa.PrimitiveBooleanJpa;
+import demoapp.dom.types.primitive.bytes.jpa.PrimitiveByteJpa;
+import demoapp.dom.types.primitive.chars.jpa.PrimitiveCharJpa;
+import demoapp.dom.types.primitive.doubles.jpa.PrimitiveDoubleJpa;
+import demoapp.dom.types.primitive.floats.jpa.PrimitiveFloatJpa;
+import demoapp.dom.types.primitive.ints.jpa.PrimitiveIntJpa;
+import demoapp.dom.types.primitive.longs.jpa.PrimitiveLongJpa;
+import demoapp.dom.types.primitive.shorts.jpa.PrimitiveShortJpa;
 
 @Configuration
 @Profile("demo-jpa")
@@ -45,6 +53,16 @@ import demoapp.dom.types.javalang.strings.jpa.JavaLangStringJpa;
 })
 @EntityScan(basePackageClasses = {
         JavaLangStringJpa.class,
+
+        PrimitiveBooleanJpa.class,
+        PrimitiveDoubleJpa.class,
+        PrimitiveFloatJpa.class,
+        PrimitiveCharJpa.class,
+        PrimitiveLongJpa.class,
+        PrimitiveIntJpa.class,
+        PrimitiveShortJpa.class,
+        PrimitiveByteJpa.class,
+
         WrapperBooleanJpa.class,
         WrapperDoubleJpa.class,
         WrapperFloatJpa.class,
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/PrimitiveBooleans.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/PrimitiveBooleans.java
index 1fdf5ac..cdc28f6 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/PrimitiveBooleans.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/PrimitiveBooleans.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.booleans.jdo.PrimitiveBooleanJdo;
-import demoapp.dom.types.primitive.booleans.jdo.PrimitiveBooleanJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.booleans.persistence.PrimitiveBooleanEntity;
 import demoapp.dom.types.primitive.booleans.vm.PrimitiveBooleanVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.booleans.vm.PrimitiveBooleanVm;
         objectType = "demo.PrimitiveBooleans",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveBooleans implements HasAsciiDocDescription {
 
     public String title() {
@@ -69,13 +67,13 @@ public class PrimitiveBooleans implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveBooleanJdo> getEntities() {
+    public List<? extends PrimitiveBooleanEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveBooleanJdoEntities entities;
+    ValueHolderRepository<Boolean, ? extends PrimitiveBooleanEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpa-description.adoc
new file mode 100644
index 0000000..b2222bd
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpa-description.adoc
@@ -0,0 +1,18 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `boolean` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveBooleanJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+include::../PrimitiveBooleans-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpa.java
new file mode 100644
index 0000000..15545da
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.booleans.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.booleans.persistence.PrimitiveBooleanEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveBooleanJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveBooleanEntity"
+)
+@NoArgsConstructor
+public class PrimitiveBooleanJpa
+        extends PrimitiveBooleanEntity {
+
+//end::class[]
+    public PrimitiveBooleanJpa(boolean initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "boolean (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private boolean readOnlyProperty;                                   // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private boolean readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpaEntities.java
new file mode 100644
index 0000000..7034c80
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/booleans/jpa/PrimitiveBooleanJpaEntities.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.types.primitive.booleans.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveBooleanJpaEntities
+extends ValueHolderRepository<Boolean, PrimitiveBooleanJpa> {
+
+    protected PrimitiveBooleanJpaEntities() {
+        super(PrimitiveBooleanJpa.class);
+    }
+
+    @Override
+    protected PrimitiveBooleanJpa newDetachedEntity(Boolean value) {
+        return new PrimitiveBooleanJpa(value);
+    }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/PrimitiveBytes.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/PrimitiveBytes.java
index 6362eb3..68bd508 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/PrimitiveBytes.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/PrimitiveBytes.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.bytes.jdo.PrimitiveByteJdo;
-import demoapp.dom.types.primitive.bytes.jdo.PrimitiveByteJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.bytes.persistence.PrimitiveByteEntity;
 import demoapp.dom.types.primitive.bytes.vm.PrimitiveByteVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.bytes.vm.PrimitiveByteVm;
         objectType = "demo.PrimitiveBytes",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveBytes implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveBytes implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveByteJdo> getEntities() {
+    public List<? extends PrimitiveByteEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveByteJdoEntities entities;
+    ValueHolderRepository<Byte, ? extends PrimitiveByteEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpa-description.adoc
new file mode 100644
index 0000000..29d13a9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpa-description.adoc
@@ -0,0 +1,18 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `byte` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveByteJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+include::../PrimitiveBytes-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpa.java
new file mode 100644
index 0000000..671e844
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.bytes.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.bytes.persistence.PrimitiveByteEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveByteJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveByteEntity"
+)
+@NoArgsConstructor
+public class PrimitiveByteJpa
+        extends PrimitiveByteEntity {
+
+//end::class[]
+    public PrimitiveByteJpa(byte initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "byte (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private byte readOnlyProperty;                                  // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private byte readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpaEntities.java
new file mode 100644
index 0000000..87bbfb2
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/bytes/jpa/PrimitiveByteJpaEntities.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.types.primitive.bytes.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveByteJpaEntities
+extends ValueHolderRepository<Byte, PrimitiveByteJpa> {
+
+    protected PrimitiveByteJpaEntities() {
+        super(PrimitiveByteJpa.class);
+    }
+
+    @Override
+    protected PrimitiveByteJpa newDetachedEntity(Byte value) {
+        return new PrimitiveByteJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/PrimitiveChars.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/PrimitiveChars.java
index 00e79b1..d1ff526 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/PrimitiveChars.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/PrimitiveChars.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.chars.jdo.PrimitiveCharJdo;
-import demoapp.dom.types.primitive.chars.jdo.PrimitiveCharJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.chars.persistence.PrimitiveCharEntity;
 import demoapp.dom.types.primitive.chars.vm.PrimitiveCharVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.chars.vm.PrimitiveCharVm;
         objectType = "demo.PrimitiveChars",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveChars implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveChars implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveCharJdo> getEntities() {
+    public List<? extends PrimitiveCharEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveCharJdoEntities entities;
+    ValueHolderRepository<Character, ? extends PrimitiveCharEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpa-description.adoc
new file mode 100644
index 0000000..09440ee
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpa-description.adoc
@@ -0,0 +1,18 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `char` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveCharJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+include::../PrimitiveChars-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpa.java
new file mode 100644
index 0000000..e8fc09b
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.chars.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.chars.persistence.PrimitiveCharEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveCharJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveCharEntity"
+)
+@NoArgsConstructor
+public class PrimitiveCharJpa
+    extends PrimitiveCharEntity {
+
+//end::class[]
+    public PrimitiveCharJpa(char initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "char (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private char readOnlyProperty;                                  // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private char readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpaEntities.java
new file mode 100644
index 0000000..76c5e34
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/chars/jpa/PrimitiveCharJpaEntities.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.types.primitive.chars.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveCharJpaEntities
+extends ValueHolderRepository<Character, PrimitiveCharJpa> {
+
+    protected PrimitiveCharJpaEntities() {
+        super(PrimitiveCharJpa.class);
+    }
+
+    @Override
+    protected PrimitiveCharJpa newDetachedEntity(Character value) {
+        return new PrimitiveCharJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/PrimitiveDoubles.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/PrimitiveDoubles.java
index be6ffbe..8984745 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/PrimitiveDoubles.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/PrimitiveDoubles.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.doubles.jdo.PrimitiveDoubleJdo;
-import demoapp.dom.types.primitive.doubles.jdo.PrimitiveDoubleJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.doubles.persistence.PrimitiveDoubleEntity;
 import demoapp.dom.types.primitive.doubles.vm.PrimitiveDoubleVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.doubles.vm.PrimitiveDoubleVm;
         objectType = "demo.PrimitiveDoubles",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveDoubles implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveDoubles implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveDoubleJdo> getEntities() {
+    public List<? extends PrimitiveDoubleEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveDoubleJdoEntities entities;
+    ValueHolderRepository<Double, ? extends PrimitiveDoubleEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpa-description.adoc
new file mode 100644
index 0000000..7aa0fc5
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpa-description.adoc
@@ -0,0 +1,19 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `double` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveDoubleJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+
+include::../PrimitiveDoubles-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpa.java
new file mode 100644
index 0000000..5b8ab6e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.doubles.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.doubles.persistence.PrimitiveDoubleEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveDoubleJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveDoubleEntity"
+)
+@NoArgsConstructor
+public class PrimitiveDoubleJpa
+        extends PrimitiveDoubleEntity {
+
+//end::class[]
+    public PrimitiveDoubleJpa(double initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "double (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private double readOnlyProperty;                                // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private double readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpaEntities.java
new file mode 100644
index 0000000..08ab168
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/doubles/jpa/PrimitiveDoubleJpaEntities.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.types.primitive.doubles.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveDoubleJpaEntities
+extends ValueHolderRepository<Double, PrimitiveDoubleJpa> {
+
+    protected PrimitiveDoubleJpaEntities() {
+        super(PrimitiveDoubleJpa.class);
+    }
+
+    @Override
+    protected PrimitiveDoubleJpa newDetachedEntity(Double value) {
+        return new PrimitiveDoubleJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/PrimitiveFloats.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/PrimitiveFloats.java
index db236b4..79e8a24 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/PrimitiveFloats.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/PrimitiveFloats.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.floats.jdo.PrimitiveFloatJdo;
-import demoapp.dom.types.primitive.floats.jdo.PrimitiveFloatJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.floats.persistence.PrimitiveFloatEntity;
 import demoapp.dom.types.primitive.floats.vm.PrimitiveFloatVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.floats.vm.PrimitiveFloatVm;
         objectType = "demo.PrimitiveFloats",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveFloats implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveFloats implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveFloatJdo> getEntities() {
+    public List<? extends PrimitiveFloatEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveFloatJdoEntities entities;
+    ValueHolderRepository<Float, ? extends PrimitiveFloatEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpa-description.adoc
new file mode 100644
index 0000000..96b09f2
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpa-description.adoc
@@ -0,0 +1,19 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `float` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveFloatJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+
+include::../PrimitiveFloats-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpa.java
new file mode 100644
index 0000000..5fd0d4b
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.floats.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.floats.persistence.PrimitiveFloatEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveFloatJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveFloatEntity"
+)
+@NoArgsConstructor
+public class PrimitiveFloatJpa
+        extends PrimitiveFloatEntity {
+
+//end::class[]
+    public PrimitiveFloatJpa(float initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "float (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private float readOnlyProperty;                                 // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private float readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpaEntities.java
new file mode 100644
index 0000000..96f2bcb
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/floats/jpa/PrimitiveFloatJpaEntities.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.types.primitive.floats.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveFloatJpaEntities
+extends ValueHolderRepository<Float, PrimitiveFloatJpa> {
+
+    protected PrimitiveFloatJpaEntities() {
+        super(PrimitiveFloatJpa.class);
+    }
+
+    @Override
+    protected PrimitiveFloatJpa newDetachedEntity(Float value) {
+        return new PrimitiveFloatJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/PrimitiveInts.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/PrimitiveInts.java
index 572afb6..0b892f8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/PrimitiveInts.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/PrimitiveInts.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.ints.jdo.PrimitiveIntJdo;
-import demoapp.dom.types.primitive.ints.jdo.PrimitiveIntJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.ints.persistence.PrimitiveIntEntity;
 import demoapp.dom.types.primitive.ints.vm.PrimitiveIntVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.ints.vm.PrimitiveIntVm;
         objectType = "demo.PrimitiveInts",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveInts implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveInts implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveIntJdo> getEntities() {
+    public List<? extends PrimitiveIntEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveIntJdoEntities entities;
+    ValueHolderRepository<Integer, ? extends PrimitiveIntEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpa-description.adoc
new file mode 100644
index 0000000..c017d2e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpa-description.adoc
@@ -0,0 +1,19 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `int` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveIntJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+
+include::../PrimitiveInts-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpa.java
new file mode 100644
index 0000000..08df21e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.ints.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.ints.persistence.PrimitiveIntEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveIntJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveIntEntity"
+)
+@NoArgsConstructor
+public class PrimitiveIntJpa
+        extends PrimitiveIntEntity {
+
+//end::class[]
+    public PrimitiveIntJpa(int initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "int (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private int readOnlyProperty;                                  // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private int readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpaEntities.java
new file mode 100644
index 0000000..a9e1f7a
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/ints/jpa/PrimitiveIntJpaEntities.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.types.primitive.ints.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveIntJpaEntities
+extends ValueHolderRepository<Integer, PrimitiveIntJpa> {
+
+    protected PrimitiveIntJpaEntities() {
+        super(PrimitiveIntJpa.class);
+    }
+
+    @Override
+    protected PrimitiveIntJpa newDetachedEntity(Integer value) {
+        return new PrimitiveIntJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/PrimitiveLongs.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/PrimitiveLongs.java
index e728c07..28e7876 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/PrimitiveLongs.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/PrimitiveLongs.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.longs.jdo.PrimitiveLongJdo;
-import demoapp.dom.types.primitive.longs.jdo.PrimitiveLongJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.longs.persistence.PrimitiveLongEntity;
 import demoapp.dom.types.primitive.longs.vm.PrimitiveLongVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.longs.vm.PrimitiveLongVm;
         objectType = "demo.PrimitiveLongs",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveLongs implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveLongs implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveLongJdo> getEntities() {
+    public List<? extends PrimitiveLongEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveLongJdoEntities entities;
+    ValueHolderRepository<Long, ? extends PrimitiveLongEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpa-description.adoc
new file mode 100644
index 0000000..4c19009
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpa-description.adoc
@@ -0,0 +1,19 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `long` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveLongJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+
+include::../PrimitiveLongs-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpa.java
new file mode 100644
index 0000000..1fc53e9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.longs.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.longs.persistence.PrimitiveLongEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveLongJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveLongEntity"
+)
+@NoArgsConstructor
+public class PrimitiveLongJpa
+        extends PrimitiveLongEntity {
+
+//end::class[]
+    public PrimitiveLongJpa(long initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "long (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private long readOnlyProperty;                                  // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private long readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpaEntities.java
new file mode 100644
index 0000000..621bf55
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/longs/jpa/PrimitiveLongJpaEntities.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.types.primitive.longs.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveLongJpaEntities
+extends ValueHolderRepository<Long, PrimitiveLongJpa> {
+
+    protected PrimitiveLongJpaEntities() {
+        super(PrimitiveLongJpa.class);
+    }
+
+    @Override
+    protected PrimitiveLongJpa newDetachedEntity(Long value) {
+        return new PrimitiveLongJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts.java
index 1cf593b..194c64b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts.java
@@ -36,11 +36,9 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.SemanticsOf;
 
-import lombok.extern.log4j.Log4j2;
-
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.types.primitive.shorts.jdo.PrimitiveShortJdo;
-import demoapp.dom.types.primitive.shorts.jdo.PrimitiveShortJdoEntities;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.primitive.shorts.persistence.PrimitiveShortEntity;
 import demoapp.dom.types.primitive.shorts.vm.PrimitiveShortVm;
 
 @XmlRootElement(name = "Demo")
@@ -51,7 +49,7 @@ import demoapp.dom.types.primitive.shorts.vm.PrimitiveShortVm;
         objectType = "demo.PrimitiveShorts",
         editing=Editing.ENABLED
 )
-@Log4j2
+//@Log4j2
 public class PrimitiveShorts implements HasAsciiDocDescription {
 
     public String title() {
@@ -68,13 +66,13 @@ public class PrimitiveShorts implements HasAsciiDocDescription {
     }
 
     @Collection
-    public List<PrimitiveShortJdo> getEntities() {
+    public List<? extends PrimitiveShortEntity> getEntities() {
         return entities.all();
     }
 
     @Inject
     @XmlTransient
-    PrimitiveShortJdoEntities entities;
+    ValueHolderRepository<Short, ? extends PrimitiveShortEntity> entities;
 
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpa-description.adoc
new file mode 100644
index 0000000..25a5b00
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpa-description.adoc
@@ -0,0 +1,19 @@
+: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 this yet is just a copy from JDO
+====
+
+JDO supports `short` link:http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_primitive_and_java_lang_types[out-of-the-box], so no special annotations are required.
+
+[source,java]
+----
+include::PrimitiveShortJpa.java[tags="class"]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> no additional JDO annotations required.
+
+
+
+include::../PrimitiveShorts-common.adoc[]
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpa.java
new file mode 100644
index 0000000..3fa33a9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpa.java
@@ -0,0 +1,79 @@
+/*
+ *  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.types.primitive.shorts.jpa;
+
+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.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+import org.apache.isis.persistence.jpa.applib.integration.JpaEntityInjectionPointResolver;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.primitive.shorts.persistence.PrimitiveShortEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "PrimitiveShortJpa"
+)
+@EntityListeners(JpaEntityInjectionPointResolver.class)
+@DomainObject(
+      objectType = "demo.PrimitiveShortEntity"
+)
+@NoArgsConstructor
+public class PrimitiveShortJpa
+        extends PrimitiveShortEntity {
+
+//end::class[]
+    public PrimitiveShortJpa(short initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "short (primitive) JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Getter @Setter
+    private short readOnlyProperty;                                 // <.>
+
+    @Property(editing = Editing.ENABLED)
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Getter @Setter
+    private short readWriteProperty;
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpaEntities.java
new file mode 100644
index 0000000..e2727ed
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/jpa/PrimitiveShortJpaEntities.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.types.primitive.shorts.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class PrimitiveShortJpaEntities
+extends ValueHolderRepository<Short, PrimitiveShortJpa> {
+
+    protected PrimitiveShortJpaEntities() {
+        super(PrimitiveShortJpa.class);
+    }
+
+    @Override
+    protected PrimitiveShortJpa newDetachedEntity(Short value) {
+        return new PrimitiveShortJpa(value);
+    }
+
+}
\ No newline at end of file