You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2024/05/23 05:20:27 UTC
(causeway-app-petclinic) branch v2 updated: defines PetOwner's title using title() method rather than @Title annot.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git
The following commit(s) were added to refs/heads/v2 by this push:
new c8b8cf6 defines PetOwner's title using title() method rather than @Title annot.
c8b8cf6 is described below
commit c8b8cf6c63861f4b9eac8530f8933affa458479d
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu May 23 06:12:55 2024 +0100
defines PetOwner's title using title() method rather than @Title annot.
---
.../java/domainapp/modules/petowner/dom/petowner/PetOwner.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
index d7c341c..833c426 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
@@ -23,6 +23,8 @@ import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.causeway.applib.annotation.ObjectSupport;
+
import org.springframework.lang.Nullable;
import org.apache.causeway.applib.annotation.Action;
@@ -116,8 +118,11 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
@Inject @Transient MessageService messageService;
+ @ObjectSupport
+ public String title() {
+ return getName() + (getKnownAs() != null ? " (" + getKnownAs() + ")" : "");
+ }
- @Title
@Name
@Column(length = Name.MAX_LEN, nullable = false, name = "name")
@Getter @Setter @ToString.Include