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 bbed1403d860888b8831b5e371445ccc1e041d7f Author: Dan Haywood <[email protected]> AuthorDate: Sun May 26 13:48:44 2024 +0100 updates addPet, to set the species of each --- .../main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java | 5 ++++- 1 file changed, 4 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 bf4f670..524adc3 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 @@ -59,6 +59,8 @@ import org.apache.causeway.persistence.jpa.applib.types.BlobJpaEmbeddable; import static org.apache.causeway.applib.annotation.SemanticsOf.IDEMPOTENT; import static org.apache.causeway.applib.annotation.SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE; +import domainapp.modules.petowner.value.PetSpecies; + import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -164,9 +166,10 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable { @Action @ActionLayout(associateWith = "pets", sequence = "1") - public PetOwner addPet(@PetName final String name) { + public PetOwner addPet(@PetName final String name, final PetSpecies species) { final var pet = new Pet(); pet.setName(name); + pet.setSpecies(species); pet.setPetOwner(this); pets.add(pet); return this;
