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 06:40:23 UTC
[isis-app-demo] 02/05: adds derived PetOwner#name property
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to tag tags/03-07-derived-PetOwner-name
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit ebf727f6369920d3f2c56e7d16489fafcddce5a1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 07:16:18 2021 +0100
adds derived PetOwner#name property
---
.../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java | 6 ++++++
1 file changed, 6 insertions(+)
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 6793a77..c2d08cc 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
@@ -102,6 +102,12 @@ public class PetOwner implements Comparable<PetOwner> {
return getLastName() + (getFirstName() != null ? ", " + getFirstName() : "");
}
+ @Transient
+ @PropertyLayout(fieldSetId = "name", sequence = "1")
+ public String getName() {
+ return (getFirstName() != null ? getFirstName() + " ": "") + getLastName();
+ }
+
@LastName
@Column(length = LastName.MAX_LEN, nullable = false)
@Getter @Setter @ToString.Include