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 2021/10/02 07:03:50 UTC

[isis-app-demo] 03/03: adds phoneNumber and emailAddress to PetOwner

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

danhaywood pushed a commit to tag tags/03-08-add-remaining-PetOwner-properties
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 624970722431451b2273934d8de99467f859d0dd
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 08:03:25 2021 +0100

    adds phoneNumber and emailAddress to PetOwner
---
 .../petclinic/modules/pets/dom/petowner/PetOwner.java     | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index 11de65e..6ccb3a9 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -21,7 +21,6 @@ import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.DomainObject;
 import org.apache.isis.applib.annotation.DomainObjectLayout;
-import org.apache.isis.applib.annotation.PromptStyle;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Publishing;
@@ -42,9 +41,11 @@ import lombok.Setter;
 import lombok.ToString;
 import lombok.val;
 
+import petclinic.modules.pets.types.EmailAddress;
 import petclinic.modules.pets.types.FirstName;
 import petclinic.modules.pets.types.LastName;
 import petclinic.modules.pets.types.Notes;
+import petclinic.modules.pets.types.PhoneNumber;
 
 
 @Entity
@@ -121,6 +122,18 @@ public class PetOwner implements Comparable<PetOwner> {
     @Property(hidden = Where.EVERYWHERE)
     private String firstName;
 
+    @PhoneNumber
+    @Column(length = PhoneNumber.MAX_LEN, nullable = true)
+    @PropertyLayout(fieldSetId = "name", sequence = "1.5")
+    @Getter @Setter
+    private String phoneNumber;
+
+    @EmailAddress
+    @Column(length = EmailAddress.MAX_LEN, nullable = true)
+    @PropertyLayout(fieldSetId = "name", sequence = "1.6")
+    @Getter @Setter
+    private String emailAddress;
+
     @Notes
     @Column(length = Notes.MAX_LEN, nullable = true)
     @Getter @Setter