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 2026/04/09 10:56:08 UTC

(causeway-app-petclinic) tag tags/3.6.0/03-02-define-PetOwner-title-imperatively created (now 0eb760b)

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

danhaywood pushed a change to tag tags/3.6.0/03-02-define-PetOwner-title-imperatively
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git


      at 0eb760b  (commit)
This tag includes the following new commits:

     new 0eb760b  defines PetOwner's title using title() method rather than @Title annot.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(causeway-app-petclinic) 01/01: defines PetOwner's title using title() method rather than @Title annot.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to tag tags/3.6.0/03-02-define-PetOwner-title-imperatively
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit 0eb760b5efa8ab992567c47d5aab74bd81b5030a
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 81b23e6..796ac5d 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 jakarta.persistence.Version;
 import jakarta.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 static PetOwner withName(final String name) {
     @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