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/26 11:54:50 UTC
(causeway-app-petclinic) branch v2 updated (ee5023a -> 5241f5b)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git
discard ee5023a adds Pet entity
discard e8d5122 adds PetName meta-annotation
discard 24a242b organizes imports
new 8ea0e20 organizes imports
new 4015031 replaces PetOwner.png
new 3deb1f8 adds PetName meta-annotation
new aba92d7 adds Pet entity
new 2985eae uses the name of the pet as its title
new ff0399d adds Pet.layout.xml
new 19ae5a7 adds icon .png for Pet
new 6229e84 adds Pet.columnOrder.txt
new bdb96f6 adds pets collection to PetOwner
new ec4fa48 positions 'pets' collection in layout.xml
new a4c286f adds .columnOrder.txt for pets collection in PetOwner
new 30a55d3 adds 'addPet' action
new 5241f5b adds 'removePet' action
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (ee5023a)
\
N -- N -- N refs/heads/v2 (5241f5b)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 13 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.
Summary of changes:
.../modules/petowner/dom/pet/Pet.columnOrder.txt | 3 ++-
.../domainapp/modules/petowner/dom/pet/Pet.java | 7 ++---
.../modules/petowner/dom/pet/Pet.layout.xml | 1 -
.../domainapp/modules/petowner/dom/pet/Pet.png | Bin 0 -> 1677 bytes
.../dom/petowner/PetOwner#pets.columnOrder.txt | 3 ++-
.../modules/petowner/dom/petowner/PetOwner.java | 29 ++++++++++++++++++++-
.../petowner/dom/petowner/PetOwner.layout.xml | 5 ++++
.../modules/petowner/dom/petowner/PetOwner.png | Bin 653 -> 2823 bytes
8 files changed, 41 insertions(+), 7 deletions(-)
copy module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.columnOrder.txt => module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.columnOrder.txt (50%)
copy module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml => module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.layout.xml (97%)
create mode 100644 module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.png
copy module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.columnOrder.txt => module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner#pets.columnOrder.txt (50%)
(causeway-app-petclinic) 05/13: uses the name of the pet as its title
Posted by da...@apache.org.
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 2985eaeaf3549934ea149ed1b77e197daa912495
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:49:25 2024 +0100
uses the name of the pet as its title
---
.../src/main/java/domainapp/modules/petowner/dom/pet/Pet.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java
index 991a18d..8e52dcb 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java
@@ -30,6 +30,7 @@ import org.apache.causeway.applib.annotation.DomainObject;
import org.apache.causeway.applib.annotation.DomainObjectLayout;
import org.apache.causeway.applib.annotation.PropertyLayout;
import org.apache.causeway.applib.annotation.Publishing;
+import org.apache.causeway.applib.annotation.Title;
import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener;
@@ -75,6 +76,7 @@ public class Pet implements Comparable<Pet> {
private PetOwner petOwner;
@PetName
+ @Title
@Column(name = "name", length = PetName.MAX_LEN, nullable = false)
@Getter @Setter
@PropertyLayout(fieldSetId = "identity", sequence = "2")
(causeway-app-petclinic) 13/13: adds 'removePet' action
Posted by da...@apache.org.
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 5241f5b3b2842e8d733e7e2c896a184fb9e37556
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:52:14 2024 +0100
adds 'removePet' action
---
.../java/domainapp/modules/petowner/dom/petowner/PetOwner.java | 7 +++++++
1 file changed, 7 insertions(+)
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 0547b0d..d0a4fe4 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
@@ -171,6 +171,13 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
return this;
}
+ @Action(choicesFrom = "pets")
+ @ActionLayout(associateWith = "pets", sequence = "2")
+ public PetOwner removePet(@PetName final Pet pet) {
+ pets.remove(pet);
+ return this;
+ }
+
@AttributeOverrides({
@AttributeOverride(name="name", column=@Column(name="attachment_name")),
(causeway-app-petclinic) 06/13: adds Pet.layout.xml
Posted by da...@apache.org.
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 ff0399de4254d46ab507ca374abbe02216a1ea63
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:01:50 2024 +0100
adds Pet.layout.xml
---
.../modules/petowner/dom/pet/Pet.layout.xml | 54 ++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.layout.xml b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.layout.xml
new file mode 100644
index 0000000..4868032
--- /dev/null
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.layout.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:cpt="https://causeway.apache.org/applib/layout/component"
+ xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <bs3:row>
+ <bs3:col span="12" unreferencedActions="true">
+ <cpt:domainObject bookmarking="AS_ROOT"/>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="6">
+ <bs3:row>
+ <bs3:col span="12">
+ <bs3:tabGroup>
+ <bs3:tab name="Identity">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Identity" id="identity"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Other">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Metadata">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Metadata" id="metadata"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ </bs3:tabGroup>
+ </bs3:col>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Details" id="details"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:col>
+ <bs3:col span="6">
+ <bs3:row>
+ <bs3:col span="12">
+ </bs3:col>
+ </bs3:row>
+ <bs3:tabGroup unreferencedCollections="true">
+ </bs3:tabGroup>
+ </bs3:col>
+ </bs3:row>
+</bs3:grid>
(causeway-app-petclinic) 09/13: adds pets collection to PetOwner
Posted by da...@apache.org.
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 bdb96f671ebd4195eaab188e115da52eeefaead1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 11:56:21 2024 +0100
adds pets collection to PetOwner
---
.../domainapp/modules/petowner/dom/petowner/PetOwner.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
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 4f6f2d5..d845dd3 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
@@ -4,11 +4,14 @@ import java.time.LocalTime;
import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.Comparator;
+import java.util.Set;
+import java.util.TreeSet;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
@@ -18,6 +21,7 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
@@ -29,6 +33,7 @@ import org.springframework.lang.Nullable;
import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.BookmarkPolicy;
+import org.apache.causeway.applib.annotation.Collection;
import org.apache.causeway.applib.annotation.DomainObject;
import org.apache.causeway.applib.annotation.DomainObjectLayout;
import org.apache.causeway.applib.annotation.Editing;
@@ -36,7 +41,6 @@ import org.apache.causeway.applib.annotation.MemberSupport;
import org.apache.causeway.applib.annotation.ObjectSupport;
import org.apache.causeway.applib.annotation.Optionality;
import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
import org.apache.causeway.applib.annotation.Publishing;
import org.apache.causeway.applib.annotation.TableDecorator;
import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
@@ -62,6 +66,7 @@ import lombok.ToString;
import lombok.val;
import domainapp.modules.petowner.PetOwnerModule;
+import domainapp.modules.petowner.dom.pet.Pet;
import domainapp.modules.petowner.types.Name;
import domainapp.modules.petowner.types.Notes;
import domainapp.modules.petowner.types.PhoneNumber;
@@ -150,7 +155,10 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
@Property(commandPublishing = Publishing.ENABLED, executionPublishing = Publishing.ENABLED)
private String notes;
-
+ @Collection
+ @Getter
+ @OneToMany(mappedBy = "petOwner", cascade = CascadeType.ALL, orphanRemoval = true)
+ private Set<Pet> pets = new TreeSet<>();
@AttributeOverrides({
@AttributeOverride(name="name", column=@Column(name="attachment_name")),
(causeway-app-petclinic) 01/13: organizes imports
Posted by da...@apache.org.
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 8ea0e207a57261ffedf70c4844d5f89454f6882c
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 10:17:58 2024 +0100
organizes imports
---
.../src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java | 1 -
1 file changed, 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 c822ca5..4f6f2d5 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
@@ -40,7 +40,6 @@ import org.apache.causeway.applib.annotation.PropertyLayout;
import org.apache.causeway.applib.annotation.Publishing;
import org.apache.causeway.applib.annotation.TableDecorator;
import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
-import org.apache.causeway.applib.layout.LayoutConstants;
import org.apache.causeway.applib.services.clock.ClockService;
import org.apache.causeway.applib.services.message.MessageService;
import org.apache.causeway.applib.services.repository.RepositoryService;
(causeway-app-petclinic) 04/13: adds Pet entity
Posted by da...@apache.org.
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 aba92d784a6a05fda3b90ed4306888483074e415
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:01:10 2024 +0100
adds Pet entity
---
.../domainapp/modules/petowner/dom/pet/Pet.java | 92 ++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java
new file mode 100644
index 0000000..991a18d
--- /dev/null
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.java
@@ -0,0 +1,92 @@
+package domainapp.modules.petowner.dom.pet;
+
+import domainapp.modules.petowner.PetOwnerModule;
+import domainapp.modules.petowner.dom.petowner.PetOwner;
+import domainapp.modules.petowner.types.PetName;
+
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.util.Comparator;
+
+import javax.inject.Named;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.persistence.Version;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.DomainObjectLayout;
+import org.apache.causeway.applib.annotation.PropertyLayout;
+import org.apache.causeway.applib.annotation.Publishing;
+import org.apache.causeway.applib.jaxb.PersistentEntityAdapter;
+import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener;
+
+@Entity
+@Table(
+ schema= PetOwnerModule.SCHEMA,
+ uniqueConstraints = {
+ @UniqueConstraint(name = "Pet__owner_name__UNQ", columnNames = {"owner_id, name"})
+ }
+)
+@EntityListeners(CausewayEntityListener.class)
+@Named(PetOwnerModule.NAMESPACE + ".Pet")
+@DomainObject(entityChangePublishing = Publishing.ENABLED)
+@DomainObjectLayout()
+@NoArgsConstructor(access = AccessLevel.PUBLIC)
+@XmlJavaTypeAdapter(PersistentEntityAdapter.class)
+@ToString(onlyExplicitlyIncluded = true)
+public class Pet implements Comparable<Pet> {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ @Column(name = "id", nullable = false)
+ @Getter @Setter
+ private Long id;
+
+ @Version
+ @Column(name = "version", nullable = false)
+ @PropertyLayout(fieldSetId = "metadata", sequence = "999")
+ @Getter @Setter
+ private long version;
+
+
+ Pet(PetOwner petOwner, String name) {
+ this.petOwner = petOwner;
+ this.name = name;
+ }
+
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "owner_id")
+ @PropertyLayout(fieldSetId = "identity", sequence = "1")
+ @Getter @Setter
+ private PetOwner petOwner;
+
+ @PetName
+ @Column(name = "name", length = PetName.MAX_LEN, nullable = false)
+ @Getter @Setter
+ @PropertyLayout(fieldSetId = "identity", sequence = "2")
+ private String name;
+
+
+ private final static Comparator<Pet> comparator =
+ Comparator.comparing(Pet::getPetOwner).thenComparing(Pet::getName);
+
+ @Override
+ public int compareTo(final Pet other) {
+ return comparator.compare(this, other);
+ }
+
+}
(causeway-app-petclinic) 08/13: adds Pet.columnOrder.txt
Posted by da...@apache.org.
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 6229e8474f9cb051bb576b8a068d380916849c1b
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:04:01 2024 +0100
adds Pet.columnOrder.txt
---
.../main/java/domainapp/modules/petowner/dom/pet/Pet.columnOrder.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.columnOrder.txt b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.columnOrder.txt
new file mode 100644
index 0000000..abd56bc
--- /dev/null
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.columnOrder.txt
@@ -0,0 +1,4 @@
+petOwner
+name
+#id
+#version
(causeway-app-petclinic) 11/13: adds .columnOrder.txt for pets collection in PetOwner
Posted by da...@apache.org.
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 a4c286fad6ef188dd10309d96ee9ed4eabfdce54
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 11:57:03 2024 +0100
adds .columnOrder.txt for pets collection in PetOwner
---
.../modules/petowner/dom/petowner/PetOwner#pets.columnOrder.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner#pets.columnOrder.txt b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner#pets.columnOrder.txt
new file mode 100644
index 0000000..00bdbeb
--- /dev/null
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner#pets.columnOrder.txt
@@ -0,0 +1,4 @@
+name
+#id
+#version
+#petOwner
\ No newline at end of file
(causeway-app-petclinic) 02/13: replaces PetOwner.png
Posted by da...@apache.org.
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 4015031736ed791146296e4b222a48ad5297bd4b
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:12:12 2024 +0100
replaces PetOwner.png
... with something more representative (https://icons8.com/icons/set/person--icons8)
---
.../modules/petowner/dom/petowner/PetOwner.png | Bin 653 -> 2823 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.png b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.png
index 0bd6f57..4dd0e64 100644
Binary files a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.png and b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.png differ
(causeway-app-petclinic) 10/13: positions 'pets' collection in layout.xml
Posted by da...@apache.org.
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 ec4fa48715738837eccc9a4e281dc30fd16a4714
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 11:56:43 2024 +0100
positions 'pets' collection in layout.xml
---
.../java/domainapp/modules/petowner/dom/petowner/PetOwner.layout.xml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.layout.xml b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.layout.xml
index 72ad53e..b9a0929 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.layout.xml
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.layout.xml
@@ -65,6 +65,11 @@
<bs3:col span="6">
<bs3:row>
<bs3:col span="12">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:collection id="pets"/>
+ </bs3:col>
+ </bs3:row>
<cpt:fieldSet name="Content" id="content">
<cpt:property id="attachment">
<cpt:action id="updateAttachment" position="PANEL"/>
(causeway-app-petclinic) 12/13: adds 'addPet' action
Posted by da...@apache.org.
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 30a55d35d18efb5d795c91b52fac53f78ebdc7df
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:51:17 2024 +0100
adds 'addPet' action
---
.../domainapp/modules/petowner/dom/petowner/PetOwner.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
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 d845dd3..0547b0d 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
@@ -69,6 +69,7 @@ import domainapp.modules.petowner.PetOwnerModule;
import domainapp.modules.petowner.dom.pet.Pet;
import domainapp.modules.petowner.types.Name;
import domainapp.modules.petowner.types.Notes;
+import domainapp.modules.petowner.types.PetName;
import domainapp.modules.petowner.types.PhoneNumber;
import domainapp.modules.petowner.value.EmailAddress;
@@ -160,6 +161,17 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
@OneToMany(mappedBy = "petOwner", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<Pet> pets = new TreeSet<>();
+ @Action
+ @ActionLayout(associateWith = "pets", sequence = "1")
+ public PetOwner addPet(@PetName final String name) {
+ final var pet = new Pet();
+ pet.setName(name);
+ pet.setPetOwner(this);
+ pets.add(pet);
+ return this;
+ }
+
+
@AttributeOverrides({
@AttributeOverride(name="name", column=@Column(name="attachment_name")),
@AttributeOverride(name="mimeType",column=@Column(name="attachment_mimeType")),
(causeway-app-petclinic) 03/13: adds PetName meta-annotation
Posted by da...@apache.org.
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 3deb1f80aa7b640d0edbdfef567cae8c7d474fa2
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 11:34:10 2024 +0100
adds PetName meta-annotation
---
.../domainapp/modules/petowner/types/PetName.java | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/types/PetName.java b/module-petowner/src/main/java/domainapp/modules/petowner/types/PetName.java
new file mode 100644
index 0000000..292a4b7
--- /dev/null
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/types/PetName.java
@@ -0,0 +1,22 @@
+package domainapp.modules.petowner.types;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.causeway.applib.annotation.Optionality;
+import org.apache.causeway.applib.annotation.Parameter;
+import org.apache.causeway.applib.annotation.ParameterLayout;
+import org.apache.causeway.applib.annotation.Property;
+
+@Property(maxLength = PetName.MAX_LEN, optionality = Optionality.MANDATORY)
+@Parameter(maxLength = PetName.MAX_LEN, optionality = Optionality.MANDATORY)
+@ParameterLayout(named = "Name")
+@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PetName {
+
+ int MAX_LEN = 60;
+
+}
(causeway-app-petclinic) 07/13: adds icon .png for Pet
Posted by da...@apache.org.
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 19ae5a7195f6e57ef789a47af98eb2ec06c4ff11
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 12:26:25 2024 +0100
adds icon .png for Pet
---
.../main/java/domainapp/modules/petowner/dom/pet/Pet.png | Bin 0 -> 1677 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.png b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.png
new file mode 100644
index 0000000..59ba584
Binary files /dev/null and b/module-petowner/src/main/java/domainapp/modules/petowner/dom/pet/Pet.png differ