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/09/16 15:54:31 UTC
(causeway-app-petclinic) tag demo-1a created (now a2c2017)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to tag demo-1a
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git
at a2c2017 (commit)
This tag includes the following new commits:
new a2c2017 adds faxNumber param to PetOwners#create
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: adds faxNumber param to PetOwners#create
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to tag demo-1a
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git
commit a2c20175c0bd630e9a188ee7f6bfaca398241e32
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 27 17:02:43 2024 +0100
adds faxNumber param to PetOwners#create
---
.../domainapp/modules/petowner/dom/petowner/PetOwners.java | 13 ++++---------
.../modules/petowner/fixture/PetOwner_persona.java | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwners.java b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwners.java
index d04f9cd..d277a7c 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwners.java
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwners.java
@@ -6,20 +6,15 @@ import jakarta.annotation.Priority;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.persistence.TypedQuery;
-import jakarta.persistence.Column;
import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.DomainService;
-import org.apache.causeway.applib.annotation.Editing;
import org.apache.causeway.applib.annotation.Optionality;
import org.apache.causeway.applib.annotation.Parameter;
import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.applib.annotation.PromptStyle;
-import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.layout.LayoutConstants;
import org.apache.causeway.applib.query.Query;
import org.apache.causeway.applib.services.repository.RepositoryService;
import org.apache.causeway.persistence.jpa.applib.services.JpaSupportService;
@@ -28,14 +23,11 @@ import domainapp.modules.petowner.types.PhoneNumber;
import domainapp.modules.petowner.value.EmailAddress;
-import lombok.Getter;
import lombok.RequiredArgsConstructor;
import domainapp.modules.petowner.PetOwnerModule;
import domainapp.modules.petowner.types.Name;
-import lombok.Setter;
-
@Named(PetOwnerModule.NAMESPACE + ".PetOwners")
@DomainService
@Priority(PriorityPrecedence.EARLY)
@@ -56,11 +48,14 @@ public class PetOwners {
@PhoneNumber
final String telephoneNumber,
@Parameter(optionality = Optionality.OPTIONAL)
- final EmailAddress emailAddress) {
+ final EmailAddress emailAddress,
+ @PhoneNumber
+ final String faxNumber) {
final var petOwner = PetOwner.withName(name);
petOwner.setKnownAs(knownAs);
petOwner.setTelephoneNumber(telephoneNumber);
petOwner.setEmailAddress(emailAddress);
+ petOwner.setFaxNumber(faxNumber);
return repositoryService.persist(petOwner);
}
diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/fixture/PetOwner_persona.java b/module-petowner/src/main/java/domainapp/modules/petowner/fixture/PetOwner_persona.java
index 721d855..0fbb27a 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/fixture/PetOwner_persona.java
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/fixture/PetOwner_persona.java
@@ -65,7 +65,7 @@ implements Persona<PetOwner, PetOwner_persona.Builder> {
@Override
protected PetOwner buildResult(final ExecutionContext ec) {
- val petOwner = petOwners.create(persona.name, null, null, null);
+ val petOwner = petOwners.create(persona.name, null, null, null, null);
if (persona.contentFileName != null) {
val bytes = toBytes(persona.contentFileName);