From d632fb0c673c9fe0647bdf27161f32cb0085a431 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 2 Dec 2023 13:38:02 +0100 Subject: Simplify POM, add more precise JPA annotations. Change-Id: I2ad299c90d578c2151b2f0b0394d50d3dab3d24f --- src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java | 9 +++++---- src/main/resources/META-INF/beans.xml | 5 +++++ src/main/resources/hibernate-types.properties | 1 - src/main/resources/hypersistence-utils.properties | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/META-INF/beans.xml delete mode 100644 src/main/resources/hibernate-types.properties create mode 100644 src/main/resources/hypersistence-utils.properties (limited to 'src') diff --git a/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java b/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java index b84e02b..c424617 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/users/UserRolePK.java @@ -6,11 +6,14 @@ import java.io.Serializable; public class UserRolePK implements Serializable { + @Column(name = "user", nullable = false) + @Id private int userId; - private int roleId; - @Column(name = "user", nullable = false) + @Column(name = "role", nullable = false) @Id + private int roleId; + public int getUserId() { return userId; } @@ -19,8 +22,6 @@ public class UserRolePK implements Serializable { this.userId = userId; } - @Column(name = "role", nullable = false) - @Id public int getRoleId() { return roleId; } diff --git a/src/main/resources/META-INF/beans.xml b/src/main/resources/META-INF/beans.xml new file mode 100644 index 0000000..6bb944c --- /dev/null +++ b/src/main/resources/META-INF/beans.xml @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/src/main/resources/hibernate-types.properties b/src/main/resources/hibernate-types.properties deleted file mode 100644 index ce36a3b..0000000 --- a/src/main/resources/hibernate-types.properties +++ /dev/null @@ -1 +0,0 @@ -hibernate.types.print.banner = false diff --git a/src/main/resources/hypersistence-utils.properties b/src/main/resources/hypersistence-utils.properties new file mode 100644 index 0000000..ce36a3b --- /dev/null +++ b/src/main/resources/hypersistence-utils.properties @@ -0,0 +1 @@ +hibernate.types.print.banner = false -- cgit v1.2.3