This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch CAUSEWAY-2873 in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 593f308a248784951e2c717d2d970b3a477bcda5 Author: Dan Haywood <[email protected]> AuthorDate: Sun May 26 11:31:18 2024 +0100 CAUSEWAY-2873: 04-01 --- .../petclinic/images/04-01/h2-console-prompt.png | Bin 0 -> 14517 bytes .../04-01/pet-and-petowner-tables-created.png | Bin 0 -> 7712 bytes .../modules/petclinic/pages/040-pet-entity.adoc | 27 +++++++++++++-------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/antora/components/tutorials/modules/petclinic/images/04-01/h2-console-prompt.png b/antora/components/tutorials/modules/petclinic/images/04-01/h2-console-prompt.png new file mode 100644 index 0000000000..d1120cd20b Binary files /dev/null and b/antora/components/tutorials/modules/petclinic/images/04-01/h2-console-prompt.png differ diff --git a/antora/components/tutorials/modules/petclinic/images/04-01/pet-and-petowner-tables-created.png b/antora/components/tutorials/modules/petclinic/images/04-01/pet-and-petowner-tables-created.png new file mode 100644 index 0000000000..9693f2e47d Binary files /dev/null and b/antora/components/tutorials/modules/petclinic/images/04-01/pet-and-petowner-tables-created.png differ diff --git a/antora/components/tutorials/modules/petclinic/pages/040-pet-entity.adoc b/antora/components/tutorials/modules/petclinic/pages/040-pet-entity.adoc index 7de8e8b96e..b8fa0c870c 100644 --- a/antora/components/tutorials/modules/petclinic/pages/040-pet-entity.adoc +++ b/antora/components/tutorials/modules/petclinic/pages/040-pet-entity.adoc @@ -26,8 +26,6 @@ mvn clean install mvn -pl spring-boot:run ---- - - === Tasks * create a meta-annotation `@PetName` for the Pet's name: @@ -52,13 +50,13 @@ public @interface PetName { ---- @Entity @Table( - schema="pets", - uniqueConstraints = { - @UniqueConstraint(name = "Pet__owner_name__UNQ", columnNames = {"owner_id, name"}) - } + schema= PetOwnerModule.SCHEMA, + uniqueConstraints = { + @UniqueConstraint(name = "Pet__owner_name__UNQ", columnNames = {"owner_id, name"}) + } ) @EntityListeners(CausewayEntityListener.class) -@Named("pets.Pet") +@Named(PetOwnerModule.NAMESPACE + ".Pet") @DomainObject(entityChangePublishing = Publishing.ENABLED) @DomainObjectLayout() @NoArgsConstructor(access = AccessLevel.PUBLIC) @@ -93,7 +91,7 @@ public class Pet implements Comparable<Pet> { private PetOwner petOwner; @PetName - @Column(name = "name", length = FirstName.MAX_LEN, nullable = false) + @Column(name = "name", length = PetName.MAX_LEN, nullable = false) @Getter @Setter @PropertyLayout(fieldSetId = "name", sequence = "2") private String name; @@ -106,11 +104,20 @@ public class Pet implements Comparable<Pet> { public int compareTo(final Pet other) { return comparator.compare(this, other); } - } ---- -Run the application, and confirm that the table is created correctly using menu:Prototyping[H2 Console]. +Run the application, and confirm that the application starts correctly. + +Login as `secman-admin` login (password: `pass`) to access the menu:Prototyping[H2 Console]: + +image::04-01/h2-console-prompt.png[] + +There is no password. + +Confirm the `Pet` table is created correctly: + +image::04-01/pet-and-petowner-tables-created.png[]
