This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
commit 6ca885159011279986589b5b184c794d164e76db Author: Hendrik Noot <noot.hendr...@swm.de> AuthorDate: Tue Jul 9 09:52:40 2024 +0200 added an entity with compound ids to TestApp0 to reproduce the problem described in TAP5-2783 --- .../java/org/example/app0/entities/CompoundIdEntity.java | 16 ++++++++++++++++ .../org/example/app0/entities/CompoundIdEntityPK.java | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/tapestry-hibernate/src/test/java/org/example/app0/entities/CompoundIdEntity.java b/tapestry-hibernate/src/test/java/org/example/app0/entities/CompoundIdEntity.java new file mode 100644 index 000000000..7c03d21e6 --- /dev/null +++ b/tapestry-hibernate/src/test/java/org/example/app0/entities/CompoundIdEntity.java @@ -0,0 +1,16 @@ +package org.example.app0.entities; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; + +/** + * This class is an example for an entity that uses a compound id. This triggers a bug with tapestry <= 5.8.6 during + * initialisation, see TAP-123. + */ +@IdClass(CompoundIdEntityPK.class) +@Entity +public class CompoundIdEntity { + @Id private Long firstId; + @Id private Long secondId; +} diff --git a/tapestry-hibernate/src/test/java/org/example/app0/entities/CompoundIdEntityPK.java b/tapestry-hibernate/src/test/java/org/example/app0/entities/CompoundIdEntityPK.java new file mode 100644 index 000000000..0d7be39ef --- /dev/null +++ b/tapestry-hibernate/src/test/java/org/example/app0/entities/CompoundIdEntityPK.java @@ -0,0 +1,13 @@ +package org.example.app0.entities; + +import java.io.Serializable; + +public class CompoundIdEntityPK implements Serializable { + private Long firstId; + private Long secondId; + + public CompoundIdEntityPK(Long firstId, Long secondId) { + this.firstId = firstId; + this.secondId = secondId; + } +}