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
commit 9f3f4d874b4b3b6066c1095ebccd5727e378e629 Author: Dan Haywood <[email protected]> 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
