You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/04/20 08:12:35 UTC

[26/58] [abbrv] isis git commit: ISIS-1521: moves subtype to ugodn

ISIS-1521: moves subtype to ugodn


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/31534e55
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/31534e55
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/31534e55

Branch: refs/heads/wip
Commit: 31534e5505fcc55b71ee850d7d1664707258f228
Parents: 9e1ea1b
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Apr 15 11:43:57 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu Apr 20 09:09:30 2017 +0100

----------------------------------------------------------------------
 .../guides/ugfun/_ugfun_class-structure.adoc    |  8 +++-
 .../_ugfun_class-structure_properties.adoc      | 42 -------------------
 .../_ugfun_core-concepts_building-blocks.adoc   |  6 +--
 .../guides/ugodn/_ugodn_hints-and-tips.adoc     |  3 ++
 ...ndling-mandatory-properties-in-subtypes.adoc | 44 ++++++++++++++++++++
 5 files changed, 56 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/31534e55/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure.adoc
index 4ea4350..bd6b28e 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure.adoc
@@ -5,8 +5,12 @@
 :_imagesdir: images/
 
 
-Apache Isis works by building a metamodel of the domain objects: entities, xref:../ugbtb/ugbtb.adoc#_ugbtb_view-models[view model]s and services.
-The class methods of both entities and view models represent both state -- (single-valued) properties and (multi-valued) collections -- and behaviour -- actions.  The class members of domain services is simpler: just behaviour, ie actions.
+Apache Isis works by building a metamodel of the domain objects: entities, domain services, view models and mixins.
+Dependent on the sort of domain object, the class methods represent
+both state -- (single-valued) properties and (multi-valued) collections -- and behaviour -- actions.
+
+More specifically, both entities and view models can have properties, collections and actions, while domain services have just actions.
+Mixins also define only actions, though depending on their semantics they may be rendered as derived properties or collections on the domain object to which they contribute.
 
 In the automatically generated UI a property is rendered as a field.
 This can be either of a value type (a string, number, date, boolean etc) or can be a reference to another entity.

http://git-wip-us.apache.org/repos/asf/isis/blob/31534e55/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure_properties.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure_properties.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure_properties.adoc
index 540ada1..ecff327 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure_properties.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_class-structure_properties.adoc
@@ -366,46 +366,4 @@ Support and maximum allowed length will vary by database vendor.
 
 
 
-[[__ugfun_class-structure_properties_handling-mandatory-properties-in-subtypes]]
-== Handling Mandatory Properties in Subtypes
-
-
-NOTE: FIXME - move to ugodn.adoc#_ugodn_hints-and-tips
-
-
-If you have a hierarchy of classes then you need to decide which inheritance strategy to use.
-
-* "table per hierarchy", or "rollup" (`InheritanceStrategy.SUPERCLASS_TABLE`) +
-+
-whereby a single table corresponds to the superclass, and also holds the properties of the subtype (or subtypes) being rolled up
-
-* "table per class" (`InheritanceStrategy.NEW_TABLE`) +
-+
-whereby there is a table for both superclass and subclass, in 1:1 correspondence
-
-* "rolldown" (`InheritanceStrategy.SUBCLASS_TABLE`) +
-+
-whereby a single table holds the properties of the subtype, and also holds the properties of its supertype
-
-In the first "rollup" case, we can have a situation where - logically speaking - the property is mandatory in the subtype - but it must be mapped as nullable in the database because it is n/a for any other subtypes that are rolled up.
-
-In this situation we must tell JDO that the column is optional, but to Apache Isis we want to enforce it being mandatory. This can be done using the `@Property(optionality=Optionality.MANDATORY)` annotation.
-
-For example:
-
-[source,java]
-----
-@javax.jdo.annotations.Inheritance(strategy = InheritanceStrategy.SUPER_TABLE)
-public class SomeSubtype extends SomeSuperType {
-    @javax.jdo.annotations.Column(allowsNull="true")
-    @Property(optionality=Optionality.MANDATORY)
-    @lombok.Getter @lombok.Setter
-    private LocalDate date;
-}
-----
-
-[TIP]
-====
-The `@Property(optionality=...)` annotation is equivalent to the older but still supported `@Optional` annotation and `@Mandatory` annotations.
-====
 

http://git-wip-us.apache.org/repos/asf/isis/blob/31534e55/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_building-blocks.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_building-blocks.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_building-blocks.adoc
index 131b470..fb106f2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_building-blocks.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_core-concepts_building-blocks.adoc
@@ -109,11 +109,11 @@ If a domain service does hold state (eg the `Scratchpad` service noted above) th
 
 Every domain object in Apache Isis consists of (at most) three types of members:
 
-* properties, such as a `Customer`'s `firstName
+* properties, such as a ``Customer``'s `firstName`
 
-* collections, such as a `Customer`'s `orders` collection of ``Order``s
+* collections, such as a ``Customer``'s `orders` collection of ``Order``s
 
-* actions, such as a `Customer'`s `placeOrder(...)` method.
+* actions, such as a ``Customer'``s `placeOrder(...)` method.
 
 Some domain objects -- specifically domain services and mixins -- only have actions.
 In the case of contributing services and mixins these actions can (depending upon their semantics and signatures) be represented as derived properties or collections on the entity/view model to which they contribute/mix-in.

http://git-wip-us.apache.org/repos/asf/isis/blob/31534e55/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips.adoc b/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips.adoc
index 61806ac..de70245 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips.adoc
@@ -23,5 +23,8 @@ See also hints-n-tips chapters in the:
 
 
 include::_ugodn_hints-and-tips_overriding-jdo-annotations.adoc[leveloffset=+1]
+include::_ugodn_hints-and-tips_handling-mandatory-properties-in-subtypes.adoc[leveloffset=+1]
+
 include::_ugodn_hints-and-tips_subtype-entity-not-fully-populated.adoc[leveloffset=+1]
 include::_ugodn_hints-and-tips_java8.adoc[leveloffset=+1]
+

http://git-wip-us.apache.org/repos/asf/isis/blob/31534e55/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips_handling-mandatory-properties-in-subtypes.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips_handling-mandatory-properties-in-subtypes.adoc b/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips_handling-mandatory-properties-in-subtypes.adoc
new file mode 100644
index 0000000..eff87e0
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/ugodn/_ugodn_hints-and-tips_handling-mandatory-properties-in-subtypes.adoc
@@ -0,0 +1,44 @@
+[[_ugodn_hints-and-tips_handling-mandatory-properties-in-subtypes]]
+= Handling Mandatory Properties in Subtypes
+: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 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.
+:_basedir: ../../
+:_imagesdir: images/
+
+
+
+If you have a hierarchy of classes then you need to decide which inheritance strategy to use.
+
+* "table per hierarchy", or "rollup" (`InheritanceStrategy.SUPERCLASS_TABLE`) +
++
+whereby a single table corresponds to the superclass, and also holds the properties of the subtype (or subtypes) being rolled up
+
+* "table per class" (`InheritanceStrategy.NEW_TABLE`) +
++
+whereby there is a table for both superclass and subclass, in 1:1 correspondence
+
+* "rolldown" (`InheritanceStrategy.SUBCLASS_TABLE`) +
++
+whereby a single table holds the properties of the subtype, and also holds the properties of its supertype
+
+In the first "rollup" case, we can have a situation where - logically speaking - the property is mandatory in the subtype - but it must be mapped as nullable in the database because it is n/a for any other subtypes that are rolled up.
+
+In this situation we must tell JDO that the column is optional, but to Apache Isis we want to enforce it being mandatory. This can be done using the `@Property(optionality=Optionality.MANDATORY)` annotation.
+
+For example:
+
+[source,java]
+----
+@javax.jdo.annotations.Inheritance(strategy = InheritanceStrategy.SUPER_TABLE)
+public class SomeSubtype extends SomeSuperType {
+    @javax.jdo.annotations.Column(allowsNull="true")
+    @Property(optionality=Optionality.MANDATORY)
+    @lombok.Getter @lombok.Setter
+    private LocalDate date;
+}
+----
+
+[TIP]
+====
+The `@Property(optionality=...)` annotation is equivalent to the older but still supported `@Optional` annotation and `@Mandatory` annotations.
+====
+