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 57fa97029b ISIS-3123: starting with generator templates
57fa97029b is described below

commit 57fa97029ba4e0012264cc6835f7abf44d7888ca
Author: andi-huber <[email protected]>
AuthorDate: Tue Aug 16 12:06:37 2022 +0200

    ISIS-3123: starting with generator templates
---
 .../apache/isis/commons/internal/base/_Files.java  | 26 ++++++
 .../demoshowcases/value/ValueTypeGenTemplate.java  | 67 ++++++++++++++-
 .../src/main/resources/Templates-common.adoc       | 66 +++++++++++++++
 .../src/main/resources/Templates-description.adoc  | 29 +++++++
 tooling/metaprog/src/main/resources/Templates.java | 82 +++++++++++++++++++
 .../src/main/resources/Templates.layout.xml        | 56 +++++++++++++
 .../src/main/resources/holder/TemplateHolder.java  | 40 +++++++++
 .../src/main/resources/holder/TemplateHolder2.java | 74 +++++++++++++++++
 .../holder/TemplateHolder_actionReturning.java     | 39 +++++++++
 .../TemplateHolder_actionReturningCollection.java  | 51 ++++++++++++
 .../holder/TemplateHolder_mixinProperty.java       | 41 ++++++++++
 ...plateHolder_updateReadOnlyOptionalProperty.java | 58 +++++++++++++
 .../TemplateHolder_updateReadOnlyProperty.java     | 53 ++++++++++++
 ...teHolder_updateReadOnlyPropertyWithChoices.java | 69 ++++++++++++++++
 .../resources/jdo/TemplateJdo-description.adoc     | 18 ++++
 .../src/main/resources/jdo/TemplateJdo.java        | 83 +++++++++++++++++++
 .../main/resources/jdo/TemplateJdoEntities.java    | 40 +++++++++
 .../resources/jpa/TemplateJpa-description.adoc     | 23 ++++++
 .../src/main/resources/jpa/TemplateJpa.java        | 95 ++++++++++++++++++++++
 .../main/resources/jpa/TemplateJpaEntities.java    | 40 +++++++++
 .../main/resources/persistence/TemplateEntity.java | 42 ++++++++++
 .../persistence/TemplateEntity.layout.xml          | 56 +++++++++++++
 .../resources/persistence/TemplateSeeding.java     | 37 +++++++++
 .../main/resources/samples/TemplateSamples.java    | 40 +++++++++
 .../main/resources/vm/TemplateVm-description.adoc  | 17 ++++
 .../metaprog/src/main/resources/vm/TemplateVm.java | 83 +++++++++++++++++++
 .../src/main/resources/vm/TemplateVm.layout.xml    | 56 +++++++++++++
 .../value/ValueTypeGenTemplateTest.java            | 52 ++++++++++--
 28 files changed, 1422 insertions(+), 11 deletions(-)

diff --git 
a/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java 
b/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java
index 5d9de43323..6dbcca2586 100644
--- a/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java
+++ b/commons/src/main/java/org/apache/isis/commons/internal/base/_Files.java
@@ -32,6 +32,8 @@ import java.util.function.Predicate;
 
 import org.springframework.lang.Nullable;
 
+import org.apache.isis.commons.internal.exceptions._Exceptions;
+
 import lombok.NonNull;
 import lombok.SneakyThrows;
 import lombok.val;
@@ -163,4 +165,28 @@ public class _Files {
         return file->realtiveFileName(root, file);
     }
 
+    /**
+     * Creates the given directory if it does not already exist.
+     * If directory is null acts as a no-op.
+     * @throws IllegalArgumentException if any pre-existing file is in conflict
+     */
+    public static void makeDir(final @Nullable File directory) {
+        if(directory==null) {
+            return; // no-op
+        }
+        if(directory.exists()) {
+            if(directory.isDirectory()) {
+                return; // nothing to do
+            }
+            throw _Exceptions.illegalArgument(
+                    "cannot create directory over pre-existing file of same 
name %s",
+                    directory.getAbsolutePath());
+        }
+        if(!directory.mkdirs()) {
+            throw _Exceptions.unrecoverable(
+                    "failed to create directory %s",
+                    directory.getAbsolutePath());
+        }
+    }
+
 }
diff --git 
a/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
 
b/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
index 264465d92e..d97e79c15e 100644
--- 
a/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
+++ 
b/tooling/metaprog/src/main/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplate.java
@@ -19,19 +19,32 @@
 package org.apache.isis.tooling.metaprog.demoshowcases.value;
 
 import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
 import java.util.function.Consumer;
 
+import org.apache.isis.commons.internal.assertions._Assert;
+import org.apache.isis.commons.internal.base._Files;
+import org.apache.isis.commons.internal.base._Refs;
+import org.apache.isis.commons.internal.base._Text;
+
 import lombok.Builder;
 import lombok.RequiredArgsConstructor;
+import lombok.Singular;
 import lombok.Value;
 import lombok.val;
 
+@RequiredArgsConstructor
 public class ValueTypeGenTemplate {
 
     @Value @Builder
     public static class Config {
         final File outputRootDir;
         final String showcaseName;
+        final String javaPackage;
+        @Singular final Map<String, String> templateVariables = new 
HashMap<>();
     }
 
     @RequiredArgsConstructor
@@ -78,17 +91,63 @@ public class ValueTypeGenTemplate {
         private final File file(final Config config) {
             return new File(config.getOutputRootDir(),
                     String.format(pathTemplate, config.getShowcaseName())
-                    + generator.fileSuffix);
+                    + generator.fileSuffix)
+                    .getAbsoluteFile();
+        }
+        private final File template() {
+            return new File("src/main/resources",
+                    String.format(pathTemplate, "Template")
+                    + generator.fileSuffix)
+                    .getAbsoluteFile();
+        }
+        private final String javaPackage(final Config config) {
+            return Optional.ofNullable(new File(String.format(pathTemplate, 
"X")).getParent())
+                    .map(path->path.replace('/', '.'))
+                    .map(suffix->config.javaPackage + "." + suffix)
+                    .orElse(config.javaPackage);
         }
     }
 
-    public void generate(final Config config, final Consumer<File> 
onSourceGenerated) {
+    final Config config;
+
+    public void generate(final Consumer<File> onSourceGenerated) {
 
         for(var source: Sources.values()) {
-            val gen = source.file(config);
-            onSourceGenerated.accept(gen);
+            val template = source.template();
+
+            _Assert.assertTrue(template.exists(), ()->String.format("template 
%s not found", template));
+
+            val genTarget = source.file(config);
+
+            val templateVars = new HashMap<String, String>();
+            templateVars.putAll(config.templateVariables);
+            templateVars.put("java-package", source.javaPackage(config));
+            templateVars.put("showcase-name", config.showcaseName);
+            templateVars.put("showcase-type", "java.util.UUID");
+
+            generateFromTemplate(templateVars, template, genTarget);
+            onSourceGenerated.accept(genTarget);
         }
 
     }
 
+    private void generateFromTemplate(
+            final Map<String, String> templateVars, final File template, final 
File genTarget) {
+        val templateLines = _Text.readLinesFromFile(template, 
StandardCharsets.UTF_8);
+
+        _Files.makeDir(genTarget.getParentFile());
+
+        _Text.writeLinesToFile(templateLines
+                .map(line->templateProcessor(templateVars, line)),
+                genTarget, StandardCharsets.UTF_8);
+    }
+
+    private String templateProcessor(final Map<String, String> templateVars, 
final String line) {
+        val lineRef = _Refs.stringRef(line);
+        templateVars.forEach((key, value)->{
+            lineRef.update(s->s.replace("/*${" + key + "}*/", value));
+        });
+        return lineRef.getValue();
+    }
+
 }
diff --git a/tooling/metaprog/src/main/resources/Templates-common.adoc 
b/tooling/metaprog/src/main/resources/Templates-common.adoc
new file mode 100644
index 0000000000..d249090d37
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/Templates-common.adoc
@@ -0,0 +1,66 @@
+: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 [...]
+
+== Mixin actions
+
+A number of mixin actions contribute through the `JavaUtilUuidHolder` 
interface, demonstrate the use of `java.util.UUID` as a parameter and as a 
return type.
+For example:
+
+* the `updateReadOnlyProperty` action is:
++
+[source,java]
+----
+include::holder/JavaUtilUuidHolder_updateReadOnlyProperty.java[tags=class]
+----
+
+* the `updateReadOnlyOptionalProperty` action is:
++
+[source,java]
+----
+include::holder/JavaUtilUuidHolder_updateReadOnlyOptionalProperty.java[tags=class]
+----
+
+* the `actionReturning` action is:
++
+[source,java]
+----
+include::holder/JavaUtilUuidHolder_actionReturning.java[tags=class]
+----
+
+
+* the `actionReturningCollection` action is:
++
+[source,java]
+----
+include::holder/JavaUtilUuidHolder_actionReturningCollection.java[tags=class]
+----
+
+== Mixin properties
+
+We also use the interface to contribute a mixin property:
+
+* the `mixinProperty` property:
++
+[source,java]
+----
+include::holder/JavaUtilUuidHolder_mixinProperty.java[tags=class]
+----
+
+
+== @PropertyLayout(labelPosition=...)
+
+To demonstrate support for label positions using 
`@PropertyLayout(labelPosition=...)`, the entity and view model objects both 
implement the extended `JavaUtilUuidHolder2` interface:
+
+[source,java]
+----
+include::holder/JavaUtilUuidHolder2.java[tags=class]
+----
+
+<.> The default methods have annotations that are automatically inherited.
+<.> Position to the left
+<.> Using `@PropertyLayout(fieldSetId=...)` positions the properties into the 
appropriate `<field-set>` within the `Xxx.layout.xml` layout file.
+<.> Position label on top
+<.> Position label to the right
++
+CAUTION: currently not supported
+<.> Hide the label compleely.
+
diff --git a/tooling/metaprog/src/main/resources/Templates-description.adoc 
b/tooling/metaprog/src/main/resources/Templates-description.adoc
new file mode 100644
index 0000000000..5444fb2369
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/Templates-description.adoc
@@ -0,0 +1,29 @@
+: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 framework has built-in support for the `java.util.UUID` data type.
+
+From here you can:
+
+* navigate to an entity that uses the `java.util.UUID` datatype
+* open a view model that uses the `java.util.UUID` datatype
+
+Some properties on these domain objects are mandatory, some optional.
+
+== Common interfaces
+
+The entity and view model types both implement some common interfaces.
+
+=== JavaUtilUuidHolder
+
+The `JavaUtilUuidHolder` interface is used to contribute a number of mixins to 
both types:
+
+[source,java]
+----
+include::holder/JavaUtilUuidHolder.java[tags=class]
+----
+
+=== JavaUtilUuidHolder2
+
+The `JavaUtilUuidHolder2` interface is used to demonstrate support for label 
positions using `@PropertyLayout(labelPosition=...)`.
+
+Further details, along with the effect of this annotation, can be seen on the 
entity and view model object pages.
\ No newline at end of file
diff --git a/tooling/metaprog/src/main/resources/Templates.java 
b/tooling/metaprog/src/main/resources/Templates.java
new file mode 100644
index 0000000000..ffb0f42e2a
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/Templates.java
@@ -0,0 +1,82 @@
+/*
+ *  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.javautil.uuids;
+
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.MemberSupport;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.ObjectSupport;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.types.Samples;
+import demoapp.dom.types.javautil.uuids.persistence.JavaUtilUuidEntity;
+import demoapp.dom.types.javautil.uuids.vm.JavaUtilUuidVm;
+
+@XmlRootElement(name = "Demo")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@Named("demo.JavaUtilUuids")
+@DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.ENABLED)
+//@Log4j2
+public class JavaUtilUuids implements HasAsciiDocDescription {
+
+    @ObjectSupport public String title() {
+        return "java.util.UUID data type";
+    }
+
+    @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
+    public JavaUtilUuidVm openViewModel(final java.util.UUID initialValue) {
+        return new JavaUtilUuidVm(initialValue);
+    }
+    @MemberSupport public java.util.UUID default0OpenViewModel() {
+        return samples.single();
+    }
+
+    @Collection
+    public List<? extends JavaUtilUuidEntity> getEntities() {
+        return entities.all();
+    }
+
+    @Inject
+    @XmlTransient
+    ValueHolderRepository<java.util.UUID, ? extends JavaUtilUuidEntity> 
entities;
+
+    @Inject
+    @XmlTransient
+    Samples<java.util.UUID> samples;
+
+}
diff --git a/tooling/metaprog/src/main/resources/Templates.layout.xml 
b/tooling/metaprog/src/main/resources/Templates.layout.xml
new file mode 100644
index 0000000000..74e0160a87
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/Templates.layout.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component 
http://isis.apache.org/applib/layout/component/component.xsd   
http://isis.apache.org/applib/layout/grid/bootstrap3 
http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd";
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3";
+        xmlns:cpt="http://isis.apache.org/applib/layout/component";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+
+       <bs3:row>
+               <bs3:col span="10" unreferencedActions="true">
+                       <cpt:domainObject />
+               </bs3:col>
+               <bs3:col span="2">
+                       <cpt:fieldSet name="" id="sources" />
+               </bs3:col>
+       </bs3:row>
+
+       <bs3:row>
+               <bs3:col span="6">
+                       <bs3:row>
+                               <bs3:col span="12">
+                                       <cpt:collection id="entities"/>
+                               </bs3:col>
+                               <bs3:col span="12">
+                                       <cpt:action id="openViewModel"/>
+                               </bs3:col>
+                       </bs3:row>
+                       <cpt:fieldSet name="Other" id="other" 
unreferencedProperties="true"/>
+               </bs3:col>
+               <bs3:col span="6">
+                       <cpt:fieldSet name="Description" id="description" >
+                               <cpt:action id="clearHints" position="PANEL" />
+                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
+                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
+                               <cpt:property id="description"/>
+                       </cpt:fieldSet>
+               </bs3:col>
+       </bs3:row>
+       <bs3:row>
+               <bs3:col span="12" unreferencedCollections="true"/>
+       </bs3:row>
+
+</bs3:grid>
diff --git a/tooling/metaprog/src/main/resources/holder/TemplateHolder.java 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder.java
new file mode 100644
index 0000000000..50e2c9a04a
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/holder/TemplateHolder.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.javautil.uuids.holder;
+
+import javax.inject.Named;
+
+@Named("demo.JavaUtilUuidHolder")
+//tag::class[]
+public interface JavaUtilUuidHolder {
+
+    java.util.UUID getReadOnlyProperty();
+    void setReadOnlyProperty(java.util.UUID c);
+
+    java.util.UUID getReadWriteProperty();
+    void setReadWriteProperty(java.util.UUID c);
+
+    java.util.UUID getReadOnlyOptionalProperty();
+    void setReadOnlyOptionalProperty(java.util.UUID c);
+
+    java.util.UUID getReadWriteOptionalProperty();
+    void setReadWriteOptionalProperty(java.util.UUID c);
+
+}
+//end::class[]
diff --git a/tooling/metaprog/src/main/resources/holder/TemplateHolder2.java 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder2.java
new file mode 100644
index 0000000000..cb72e2dcd5
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/holder/TemplateHolder2.java
@@ -0,0 +1,74 @@
+/*
+ *  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.javautil.uuids.holder;
+
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+//tag::class[]
+public interface JavaUtilUuidHolder2 extends JavaUtilUuidHolder {
+
+    @Property                                               // <.>
+    @PropertyLayout(
+        labelPosition = LabelPosition.LEFT,                 // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=LEFT)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "1")     // <.>
+    default java.util.UUID getReadOnlyPropertyDerivedLabelPositionLeft() {
+        return getReadOnlyProperty();
+    }
+
+    @Property
+    @PropertyLayout(
+        labelPosition = LabelPosition.TOP,                  // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=TOP)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "2")
+    default java.util.UUID getReadOnlyPropertyDerivedLabelPositionTop() {
+        return getReadOnlyProperty();
+    }
+
+    @Property
+    @PropertyLayout(
+        labelPosition = LabelPosition.RIGHT,                // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=RIGHT)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "3")
+    default java.util.UUID getReadOnlyPropertyDerivedLabelPositionRight() {
+        return getReadOnlyProperty();
+    }
+
+    @Property
+    @PropertyLayout(
+        labelPosition = LabelPosition.NONE,                 // <.>
+        describedAs =
+            "@PropertyLayout(labelPosition=NONE)",
+        hidden = Where.ALL_TABLES,
+        fieldSetId = "label-positions", sequence = "4")
+    default java.util.UUID getReadOnlyPropertyDerivedLabelPositionNone() {
+        return getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/holder/TemplateHolder_actionReturning.java
 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_actionReturning.java
new file mode 100644
index 0000000000..8b2ad29136
--- /dev/null
+++ 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_actionReturning.java
@@ -0,0 +1,39 @@
+/*
+ *  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 /*${java-package}*/;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(semantics = SemanticsOf.SAFE)
+@RequiredArgsConstructor
+public class /*${showcase-name}*/Holder_actionReturning {
+
+    private final /*${showcase-name}*/Holder holder;
+
+    public /*${showcase-type}*/ act() {
+        return holder.getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/holder/TemplateHolder_actionReturningCollection.java
 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_actionReturningCollection.java
new file mode 100644
index 0000000000..0713a737c4
--- /dev/null
+++ 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_actionReturningCollection.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.types.javautil.uuids.holder;
+
+import java.util.Collection;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.types.Samples;
+
+
+//tag::class[]
+@Action(semantics = SemanticsOf.SAFE)
+@RequiredArgsConstructor
+public class JavaUtilUuidHolder_actionReturningCollection {
+
+    private final JavaUtilUuidHolder holder;
+
+    public Collection<java.util.UUID> act() {
+        return samples.stream()
+                .collect(Collectors.toList());
+    }
+
+    @Inject
+    Samples<UUID> samples;
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/holder/TemplateHolder_mixinProperty.java 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_mixinProperty.java
new file mode 100644
index 0000000000..4ae1b46a67
--- /dev/null
+++ 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_mixinProperty.java
@@ -0,0 +1,41 @@
+/*
+ *  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.javautil.uuids.holder;
+
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Property()
+@PropertyLayout(hidden = Where.ALL_TABLES, fieldSetId = "contributed", 
sequence = "1")
+@RequiredArgsConstructor
+public class JavaUtilUuidHolder_mixinProperty {
+
+    private final JavaUtilUuidHolder holder;
+
+    public java.util.UUID prop() {
+        return holder.getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyOptionalProperty.java
 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyOptionalProperty.java
new file mode 100644
index 0000000000..6e6a9df3a3
--- /dev/null
+++ 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyOptionalProperty.java
@@ -0,0 +1,58 @@
+/*
+ *  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.javautil.uuids.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.MemberSupport;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+//tag::class[]
+@Action(
+        semantics = SemanticsOf.IDEMPOTENT
+)
+@ActionLayout(
+        promptStyle = PromptStyle.INLINE
+        , named = "Update"
+        , associateWith = "readOnlyOptionalProperty"
+        , sequence = "1")
+@RequiredArgsConstructor
+public class JavaUtilUuidHolder_updateReadOnlyOptionalProperty {
+
+    private final JavaUtilUuidHolder holder;
+
+    @MemberSupport public JavaUtilUuidHolder act(
+            @Parameter(optionality = Optionality.OPTIONAL)              // <.>
+            final java.util.UUID newValue
+    ) {
+        holder.setReadOnlyOptionalProperty(newValue);
+        return holder;
+    }
+
+    @MemberSupport public java.util.UUID default0Act() {
+        return holder.getReadOnlyOptionalProperty();
+    }
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyProperty.java
 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyProperty.java
new file mode 100644
index 0000000000..5c3eaf2ad8
--- /dev/null
+++ 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyProperty.java
@@ -0,0 +1,53 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.types.javautil.uuids.holder;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.MemberSupport;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+//tag::class[]
+@Action(
+        semantics = SemanticsOf.IDEMPOTENT
+)
+@ActionLayout(
+        promptStyle = PromptStyle.INLINE
+        , named = "Update"
+        , associateWith = "readOnlyProperty"
+        , sequence = "1")
+@RequiredArgsConstructor
+public class JavaUtilUuidHolder_updateReadOnlyProperty {
+
+    private final JavaUtilUuidHolder holder;
+
+    @MemberSupport public JavaUtilUuidHolder act(final java.util.UUID 
newValue) {
+        holder.setReadOnlyProperty(newValue);
+        return holder;
+    }
+
+    @MemberSupport public java.util.UUID default0Act() {
+        return holder.getReadOnlyProperty();
+    }
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyPropertyWithChoices.java
 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyPropertyWithChoices.java
new file mode 100644
index 0000000000..8ad9907970
--- /dev/null
+++ 
b/tooling/metaprog/src/main/resources/holder/TemplateHolder_updateReadOnlyPropertyWithChoices.java
@@ -0,0 +1,69 @@
+/*
+ *  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.javautil.uuids.holder;
+
+import java.util.List;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.MemberSupport;
+import org.apache.isis.applib.annotation.PromptStyle;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.types.Samples;
+
+//tag::class[]
+@Action(
+        semantics = SemanticsOf.IDEMPOTENT
+)
+@ActionLayout(
+        promptStyle = PromptStyle.INLINE
+        , named = "Update with choices"
+        , associateWith = "readOnlyProperty"
+        , sequence = "2")
+@RequiredArgsConstructor
+public class JavaUtilUuidHolder_updateReadOnlyPropertyWithChoices {
+
+    private final JavaUtilUuidHolder holder;
+
+    @MemberSupport public JavaUtilUuidHolder act(final java.util.UUID 
newValue) {
+        holder.setReadOnlyProperty(newValue);
+        return holder;
+    }
+
+    @MemberSupport public java.util.UUID default0Act() {
+        return holder.getReadOnlyProperty();
+    }
+
+    @MemberSupport public List<java.util.UUID> choices0Act() {
+        return samples.stream()
+                .collect(Collectors.toList());
+    }
+
+    @Inject
+    Samples<UUID> samples;
+
+}
+//end::class[]
diff --git 
a/tooling/metaprog/src/main/resources/jdo/TemplateJdo-description.adoc 
b/tooling/metaprog/src/main/resources/jdo/TemplateJdo-description.adoc
new file mode 100644
index 0000000000..d4840f05e7
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/jdo/TemplateJdo-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 [...]
+
+JDO supports `java.util.UUID` out-of-the-box, so no special annotations are 
required.
+
+[source,java]
+----
+include::JavaUtilUuidJdo.java[tags=class]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> required property as defined to JDO/DataNucleus.
++
+Apache Isis assumes properties are mandatory, so no additional annotation is 
required.
+<.> directly editable property as defined to Apache Isis
+<.> optional property as defined to Apache Isis
+<.> optional property as defined to JDO/DataNucleus
+
+
+include::../JavaUtilUuids-common.adoc[]
\ No newline at end of file
diff --git a/tooling/metaprog/src/main/resources/jdo/TemplateJdo.java 
b/tooling/metaprog/src/main/resources/jdo/TemplateJdo.java
new file mode 100644
index 0000000000..a471ff8481
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/jdo/TemplateJdo.java
@@ -0,0 +1,83 @@
+/*
+ *  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.javautil.uuids.jdo;
+
+import javax.inject.Named;
+import javax.jdo.annotations.Column;
+import javax.jdo.annotations.DatastoreIdentity;
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+
+import org.springframework.context.annotation.Profile;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import demoapp.dom.types.javautil.uuids.persistence.JavaUtilUuidEntity;
+
+@Profile("demo-jdo")
+//tag::class[]
+@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
+@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
+@Named("demo.JavaUtilUuidEntity")
+@DomainObject
+public class JavaUtilUuidJdo                                          // <.>
+        extends JavaUtilUuidEntity {
+
+//end::class[]
+    public JavaUtilUuidJdo(final java.util.UUID initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Title(prepend = "java.util.UUID JDO entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Column(allowsNull = "false")                                              
 // <.>
+    @Getter @Setter
+    private java.util.UUID readOnlyProperty;
+
+    @Property(editing = Editing.ENABLED)                                       
 // <.>
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Column(allowsNull = "false")
+    @Getter @Setter
+    private java.util.UUID readWriteProperty;
+
+    @Property(optionality = Optionality.OPTIONAL)                              
 // <.>
+    @PropertyLayout(fieldSetId = "optional-properties", sequence = "1")
+    @Column(allowsNull = "true")                                               
 // <.>
+    @Getter @Setter
+    private java.util.UUID readOnlyOptionalProperty;
+
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @PropertyLayout(fieldSetId = "optional-properties", sequence = "2")
+    @Column(allowsNull = "true")
+    @Getter @Setter
+    private java.util.UUID readWriteOptionalProperty;
+
+}
+//end::class[]
diff --git a/tooling/metaprog/src/main/resources/jdo/TemplateJdoEntities.java 
b/tooling/metaprog/src/main/resources/jdo/TemplateJdoEntities.java
new file mode 100644
index 0000000000..7016edae0b
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/jdo/TemplateJdoEntities.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.javautil.uuids.jdo;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jdo")
+@Service
+public class JavaUtilUuidJdoEntities
+extends ValueHolderRepository<java.util.UUID, JavaUtilUuidJdo> {
+
+    protected JavaUtilUuidJdoEntities() {
+        super(JavaUtilUuidJdo.class);
+    }
+
+    @Override
+    protected JavaUtilUuidJdo newDetachedEntity(java.util.UUID value) {
+        return new JavaUtilUuidJdo(value);
+    }
+
+}
\ No newline at end of file
diff --git 
a/tooling/metaprog/src/main/resources/jpa/TemplateJpa-description.adoc 
b/tooling/metaprog/src/main/resources/jpa/TemplateJpa-description.adoc
new file mode 100644
index 0000000000..98812cef37
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/jpa/TemplateJpa-description.adoc
@@ -0,0 +1,23 @@
+: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 `java.util.UUID` out-of-the-box, so no special annotations are 
required.
+
+[source,java]
+----
+include::JavaUtilUuidJpa.java[tags=class]
+----
+<.> a no-arg constructor is introduced by JDO enhancer
+<.> required property as defined to JDO/DataNucleus.
++
+Apache Isis assumes properties are mandatory, so no additional annotation is 
required.
+<.> directly editable property as defined to Apache Isis
+<.> optional property as defined to Apache Isis
+<.> optional property as defined to JDO/DataNucleus
+
+
+include::../JavaUtilUuids-common.adoc[]
\ No newline at end of file
diff --git a/tooling/metaprog/src/main/resources/jpa/TemplateJpa.java 
b/tooling/metaprog/src/main/resources/jpa/TemplateJpa.java
new file mode 100644
index 0000000000..4a6a9324a4
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/jpa/TemplateJpa.java
@@ -0,0 +1,95 @@
+/*
+ *  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.javautil.uuids.jpa;
+
+import javax.inject.Named;
+import javax.persistence.Column;
+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.Optionality;
+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.IsisEntityListener;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom.types.javautil.uuids.persistence.JavaUtilUuidEntity;
+
+@Profile("demo-jpa")
+//tag::class[]
+@Entity
+@Table(
+      schema = "demo",
+      name = "JavaUtilUuidJpa"
+)
+@EntityListeners(IsisEntityListener.class)
+@Named("demo.JavaUtilUuidEntity")
+@DomainObject
+@NoArgsConstructor
+public class JavaUtilUuidJpa
+        extends JavaUtilUuidEntity {
+
+//end::class[]
+    public JavaUtilUuidJpa(final java.util.UUID initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Id
+    @GeneratedValue
+    private Long id;
+
+    @Title(prepend = "java.util.UUID JPA entity: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @Column(nullable = false)                                                  
 // <.>
+    @Getter @Setter
+    private java.util.UUID readOnlyProperty;
+
+    @Property(editing = Editing.ENABLED)                                       
 // <.>
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @Column(nullable = false)
+    @Getter @Setter
+    private java.util.UUID readWriteProperty;
+
+    @Property(optionality = Optionality.OPTIONAL)                              
 // <.>
+    @PropertyLayout(fieldSetId = "optional-properties", sequence = "1")
+    @Column(nullable = true)                                                   
 // <.>
+    @Getter @Setter
+    private java.util.UUID readOnlyOptionalProperty;
+
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @PropertyLayout(fieldSetId = "optional-properties", sequence = "2")
+    @Column(nullable = true)
+    @Getter @Setter
+    private java.util.UUID readWriteOptionalProperty;
+
+}
+//end::class[]
diff --git a/tooling/metaprog/src/main/resources/jpa/TemplateJpaEntities.java 
b/tooling/metaprog/src/main/resources/jpa/TemplateJpaEntities.java
new file mode 100644
index 0000000000..a126d7ca6c
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/jpa/TemplateJpaEntities.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.javautil.uuids.jpa;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Profile("demo-jpa")
+@Service
+public class JavaUtilUuidJpaEntities
+extends ValueHolderRepository<java.util.UUID, JavaUtilUuidJpa> {
+
+    protected JavaUtilUuidJpaEntities() {
+        super(JavaUtilUuidJpa.class);
+    }
+
+    @Override
+    protected JavaUtilUuidJpa newDetachedEntity(java.util.UUID value) {
+        return new JavaUtilUuidJpa(value);
+    }
+
+}
\ No newline at end of file
diff --git 
a/tooling/metaprog/src/main/resources/persistence/TemplateEntity.java 
b/tooling/metaprog/src/main/resources/persistence/TemplateEntity.java
new file mode 100644
index 0000000000..445e9754f1
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/persistence/TemplateEntity.java
@@ -0,0 +1,42 @@
+/*
+ *  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.javautil.uuids.persistence;
+
+import javax.inject.Named;
+
+import org.apache.isis.applib.annotation.DomainObject;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom._infra.values.ValueHolder;
+import demoapp.dom.types.javautil.uuids.holder.JavaUtilUuidHolder2;
+
+@Named("demo.JavaUtilUuidEntity") // shared permissions with concrete sub class
+@DomainObject
+public abstract class JavaUtilUuidEntity
+implements
+    HasAsciiDocDescription,
+    JavaUtilUuidHolder2,
+    ValueHolder<java.util.UUID> {
+
+    @Override
+    public java.util.UUID value() {
+        return getReadOnlyProperty();
+    }
+
+}
diff --git 
a/tooling/metaprog/src/main/resources/persistence/TemplateEntity.layout.xml 
b/tooling/metaprog/src/main/resources/persistence/TemplateEntity.layout.xml
new file mode 100644
index 0000000000..fe9ce77481
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/persistence/TemplateEntity.layout.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component 
http://isis.apache.org/applib/layout/component/component.xsd   
http://isis.apache.org/applib/layout/grid/bootstrap3 
http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd";
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3";
+        xmlns:cpt="http://isis.apache.org/applib/layout/component";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+
+       <bs3:row>
+               <bs3:col span="10" unreferencedActions="true">
+                       <cpt:domainObject />
+                       <cpt:action id="actionReturning"/>
+                       <cpt:action id="actionReturningCollection"/>
+               </bs3:col>
+               <bs3:col span="2">
+                       <cpt:fieldSet name="" id="sources" />
+               </bs3:col>
+       </bs3:row>
+
+       <bs3:row>
+               <bs3:col span="6">
+                       <cpt:fieldSet name="Read Only Properties" 
id="read-only-properties"/>
+                       <cpt:fieldSet name="Editable Properties" 
id="editable-properties"/>
+                       <cpt:fieldSet name="Optional Properties" 
id="optional-properties"/>
+                       <cpt:fieldSet name="Contributed by Mixins" 
id="contributed"/>
+                       <cpt:fieldSet name="@PropertyLayout(labelPosition=...)" 
id="label-positions"/>
+                       <cpt:fieldSet name="Other" id="other" 
unreferencedProperties="true"/>
+               </bs3:col>
+               <bs3:col span="6">
+                       <cpt:fieldSet name="Description" id="description" >
+                               <cpt:action id="clearHints" position="PANEL" />
+                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
+                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+                               <cpt:action id="downloadJdoMetadata"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
+                               <cpt:property id="description"/>
+                       </cpt:fieldSet>
+               </bs3:col>
+       </bs3:row>
+       <bs3:row>
+               <bs3:col span="12" unreferencedCollections="true"/>
+       </bs3:row>
+
+</bs3:grid>
diff --git 
a/tooling/metaprog/src/main/resources/persistence/TemplateSeeding.java 
b/tooling/metaprog/src/main/resources/persistence/TemplateSeeding.java
new file mode 100644
index 0000000000..1712bbcb94
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/persistence/TemplateSeeding.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.types.javautil.uuids.persistence;
+
+import javax.inject.Inject;
+
+import org.springframework.stereotype.Service;
+
+import demoapp.dom._infra.seed.SeedServiceAbstract;
+import demoapp.dom._infra.values.ValueHolderRepository;
+
+@Service
+public class JavaUtilUuidSeeding
+extends SeedServiceAbstract {
+
+    @Inject
+    public JavaUtilUuidSeeding(ValueHolderRepository<java.util.UUID, ? extends 
JavaUtilUuidEntity> entities) {
+        super(entities);
+    }
+
+}
diff --git a/tooling/metaprog/src/main/resources/samples/TemplateSamples.java 
b/tooling/metaprog/src/main/resources/samples/TemplateSamples.java
new file mode 100644
index 0000000000..884066dc63
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/samples/TemplateSamples.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.javautil.uuids.samples;
+
+import java.util.UUID;
+import java.util.stream.Stream;
+
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.core.metamodel.valuesemantics.UUIDValueSemantics;
+
+import demoapp.dom.types.Samples;
+
+@Service
+public class JavaUtilUuidSamples implements Samples<UUID> {
+
+    @Override
+    public Stream<UUID> stream() {
+        return new UUIDValueSemantics()
+                .getExamples()
+                .stream();
+    }
+
+}
diff --git a/tooling/metaprog/src/main/resources/vm/TemplateVm-description.adoc 
b/tooling/metaprog/src/main/resources/vm/TemplateVm-description.adoc
new file mode 100644
index 0000000000..36e0749ced
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/vm/TemplateVm-description.adoc
@@ -0,0 +1,17 @@
+: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 [...]
+
+JAXB supports `java.util.UUID` out-of-the-box, so no special annotations are 
required.
+
+[source,java]
+----
+include::JavaUtilUuidVm.java[tags=class]
+----
+<.> a no-arg constructor is required by JAXB
+<.> required property as defined to JAXB
+<.> directly editable property as defined to Apache Isis
+<.> optional property as defined to Apache Isis.
++
+This is the default for JAXB so no additional annotation required.
+
+
+include::../JavaUtilUuids-common.adoc[]
\ No newline at end of file
diff --git a/tooling/metaprog/src/main/resources/vm/TemplateVm.java 
b/tooling/metaprog/src/main/resources/vm/TemplateVm.java
new file mode 100644
index 0000000000..91f93d8e1f
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/vm/TemplateVm.java
@@ -0,0 +1,83 @@
+/*
+ *  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.javautil.uuids.vm;
+
+import javax.inject.Named;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Title;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.types.javautil.uuids.holder.JavaUtilUuidHolder2;
+
+//tag::class[]
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@Named("demo.JavaUtilUuidVm")
+@DomainObject(
+        nature=Nature.VIEW_MODEL)
[email protected]                                                      
 // <.>
+public class JavaUtilUuidVm
+        implements HasAsciiDocDescription, JavaUtilUuidHolder2 {
+
+//end::class[]
+    public JavaUtilUuidVm(final java.util.UUID initialValue) {
+        this.readOnlyProperty = initialValue;
+        this.readWriteProperty = initialValue;
+    }
+
+//tag::class[]
+    @Title(prepend = "java.util.UUID view model: ")
+    @PropertyLayout(fieldSetId = "read-only-properties", sequence = "1")
+    @XmlElement(required = true)                                               
 // <.>
+    @Getter @Setter
+    private java.util.UUID readOnlyProperty;
+
+    @Property(editing = Editing.ENABLED)                                       
 // <.>
+    @PropertyLayout(fieldSetId = "editable-properties", sequence = "1")
+    @XmlElement(required = true)
+    @Getter @Setter
+    private java.util.UUID readWriteProperty;
+
+    @Property(optionality = Optionality.OPTIONAL)                              
 // <.>
+    @PropertyLayout(fieldSetId = "optional-properties", sequence = "1")
+    @Getter @Setter
+    private java.util.UUID readOnlyOptionalProperty;
+
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @PropertyLayout(fieldSetId = "optional-properties", sequence = "2")
+    @Getter @Setter
+    private java.util.UUID readWriteOptionalProperty;
+
+}
+//end::class[]
diff --git a/tooling/metaprog/src/main/resources/vm/TemplateVm.layout.xml 
b/tooling/metaprog/src/main/resources/vm/TemplateVm.layout.xml
new file mode 100644
index 0000000000..fe9ce77481
--- /dev/null
+++ b/tooling/metaprog/src/main/resources/vm/TemplateVm.layout.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component 
http://isis.apache.org/applib/layout/component/component.xsd   
http://isis.apache.org/applib/layout/grid/bootstrap3 
http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd";
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3";
+        xmlns:cpt="http://isis.apache.org/applib/layout/component";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+
+       <bs3:row>
+               <bs3:col span="10" unreferencedActions="true">
+                       <cpt:domainObject />
+                       <cpt:action id="actionReturning"/>
+                       <cpt:action id="actionReturningCollection"/>
+               </bs3:col>
+               <bs3:col span="2">
+                       <cpt:fieldSet name="" id="sources" />
+               </bs3:col>
+       </bs3:row>
+
+       <bs3:row>
+               <bs3:col span="6">
+                       <cpt:fieldSet name="Read Only Properties" 
id="read-only-properties"/>
+                       <cpt:fieldSet name="Editable Properties" 
id="editable-properties"/>
+                       <cpt:fieldSet name="Optional Properties" 
id="optional-properties"/>
+                       <cpt:fieldSet name="Contributed by Mixins" 
id="contributed"/>
+                       <cpt:fieldSet name="@PropertyLayout(labelPosition=...)" 
id="label-positions"/>
+                       <cpt:fieldSet name="Other" id="other" 
unreferencedProperties="true"/>
+               </bs3:col>
+               <bs3:col span="6">
+                       <cpt:fieldSet name="Description" id="description" >
+                               <cpt:action id="clearHints" position="PANEL" />
+                               <cpt:action id="downloadLayoutXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="rebuildMetamodel"  
position="PANEL"/>
+                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                <cpt:action id="recentCommands"  position="PANEL_DROPDOWN"/>
+                               <cpt:action id="downloadJdoMetadata"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
+                               <cpt:property id="description"/>
+                       </cpt:fieldSet>
+               </bs3:col>
+       </bs3:row>
+       <bs3:row>
+               <bs3:col span="12" unreferencedCollections="true"/>
+       </bs3:row>
+
+</bs3:grid>
diff --git 
a/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
 
b/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
index d77aaad22b..e6a914f7d8 100644
--- 
a/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
+++ 
b/tooling/metaprog/src/test/java/org/apache/isis/tooling/metaprog/demoshowcases/value/ValueTypeGenTemplateTest.java
@@ -2,17 +2,23 @@ package org.apache.isis.tooling.metaprog.demoshowcases.value;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Collection;
 import java.util.Comparator;
+import java.util.Objects;
+import java.util.Set;
 
 import org.junit.jupiter.api.Test;
 
 import org.apache.isis.commons.collections.Can;
 import org.apache.isis.commons.internal.base._Files;
+import org.apache.isis.commons.internal.base._Text;
 import org.apache.isis.commons.internal.collections._Sets;
 import org.apache.isis.commons.internal.functions._Predicates;
 import 
org.apache.isis.tooling.metaprog.demoshowcases.value.ValueTypeGenTemplate.Config;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
 import lombok.val;
 import lombok.extern.log4j.Log4j2;
@@ -37,22 +43,54 @@ class ValueTypeGenTemplateTest {
         val outputRootDir = _Files.tempDir("isis-tooling-showcases");
         log.info("tmp dir created in {}", outputRootDir);
 
-        val config = Config.builder()
+        val generator = new ValueTypeGenTemplate(Config.builder()
                 .outputRootDir(outputRootDir)
                 .showcaseName("JavaUtilUuid")
-                .build();
+                .javaPackage("demoapp.dom.types.javautil.uuids")
+                .build());
 
         val generatedFiles = _Sets.<File>newLinkedHashSet();
+        generator.generate(generatedFiles::add);
 
-        new ValueTypeGenTemplate().generate(config, generatedFiles::add);
+        assertFileSetEquals(uuidShowcaseFiles, uuidDemoDomain, generatedFiles, 
outputRootDir);
+        assertFileContentEquals(uuidShowcaseFiles, generatedFiles);
 
+    }
+
+    // -- HELPER
+
+    private void assertFileSetEquals(
+            final Set<File> setA, final File rootA,
+            final Set<File> setB, final File rootB) {
         assertEquals(
-                Can.ofCollection(uuidShowcaseFiles)
-                .map(_Files.realtiveFileName(uuidDemoDomain))
+                Can.ofCollection(setA)
+                .map(_Files.realtiveFileName(rootA))
                 .sorted(Comparator.naturalOrder()),
-                Can.ofCollection(generatedFiles)
-                .map(_Files.realtiveFileName(outputRootDir))
+                Can.ofCollection(setB)
+                .map(_Files.realtiveFileName(rootB))
                 .sorted(Comparator.naturalOrder()));
+    }
+
+
+    private void assertFileContentEquals(final Collection<File> filesA, final 
Collection<File> filesB) {
+
+        val sortedA = 
Can.ofCollection(filesA).sorted(Comparator.naturalOrder());
+        val sortedB = 
Can.ofCollection(filesB).sorted(Comparator.naturalOrder());
+
+        val equalsVector = sortedA.zipMap(sortedB, (a, b)->{
+
+            return Objects.equals(
+                    _Text.readLinesFromFile(a, StandardCharsets.UTF_8),
+                    _Text.readLinesFromFile(b, StandardCharsets.UTF_8)
+                    );
+        });
+
+        for(var flag: equalsVector) {
+            if(!flag) {
+                fail(String.format("some file contents are not equal %s", 
equalsVector));
+            }
+        }
+
 
     }
 

Reply via email to