commit 1998fe81d02f535af5895d068333bbef99b25427 parent f2cd85f70bc07bd3deacad19d688fdf139cf9484 Author: Wim Dupont <wim@wimdupont.com> Date: Sat, 20 May 2023 11:43:23 +0200 sb update Diffstat:
13 files changed, 24 insertions(+), 44 deletions(-)
diff --git a/pom.xml b/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> - <version>3.0.7</version> + <version>3.1.0</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.wimdupont</groupId> diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/ChannelDetail.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/ChannelDetail.java @@ -1,15 +1,13 @@ package com.wimdupont.sxcybot.repository.guild.dao; import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; @Entity public class ChannelDetail { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String forumUrl; private String botUpdateChannel; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/GuildEventDmer.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/GuildEventDmer.java @@ -1,16 +1,14 @@ package com.wimdupont.sxcybot.repository.guild.dao; import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; @Entity public class GuildEventDmer { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String name; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/GuildRole.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/GuildRole.java @@ -1,17 +1,15 @@ package com.wimdupont.sxcybot.repository.guild.dao; import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; @Entity public class GuildRole { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String name; private Integer orderValue; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/Poll.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/Poll.java @@ -2,9 +2,8 @@ package com.wimdupont.sxcybot.repository.guild.dao; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -16,8 +15,7 @@ import java.time.LocalDateTime; public class Poll { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String messageId; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/Rule.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/Rule.java @@ -1,16 +1,14 @@ package com.wimdupont.sxcybot.repository.guild.dao; import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; @Entity public class Rule { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private int number; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/User.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/dao/User.java @@ -2,9 +2,8 @@ package com.wimdupont.sxcybot.repository.guild.dao; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -16,8 +15,7 @@ import java.time.LocalDate; public class User { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String name; private String description; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/pvmrole/dao/PvmKcSnapshot.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/pvmrole/dao/PvmKcSnapshot.java @@ -3,12 +3,11 @@ package com.wimdupont.sxcybot.repository.guild.pvmrole.dao; import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -22,8 +21,7 @@ import java.util.List; public class PvmKcSnapshot { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; @ManyToOne diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/pvmrole/dao/PvmRoleUser.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/pvmrole/dao/PvmRoleUser.java @@ -2,9 +2,8 @@ package com.wimdupont.sxcybot.repository.guild.pvmrole.dao; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -16,8 +15,7 @@ import java.time.LocalDateTime; public class PvmRoleUser { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String rsn; private String discordId; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/guild/pvmrole/dao/PvmUserKc.java b/src/main/java/com/wimdupont/sxcybot/repository/guild/pvmrole/dao/PvmUserKc.java @@ -3,12 +3,11 @@ package com.wimdupont.sxcybot.repository.guild.pvmrole.dao; import com.wimdupont.sxcybot.repository.osrs.dao.OsrsHiscoreBoss; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToOne; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -20,8 +19,7 @@ import java.time.LocalDateTime; public class PvmUserKc { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; @OneToOne diff --git a/src/main/java/com/wimdupont/sxcybot/repository/osrs/dao/OsrsHiscoreBoss.java b/src/main/java/com/wimdupont/sxcybot/repository/osrs/dao/OsrsHiscoreBoss.java @@ -4,13 +4,13 @@ import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; @Entity public class OsrsHiscoreBoss { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String name; private int orderValue; diff --git a/src/main/java/com/wimdupont/sxcybot/repository/osrs/dao/OsrsHiscoreStat.java b/src/main/java/com/wimdupont/sxcybot/repository/osrs/dao/OsrsHiscoreStat.java @@ -1,16 +1,14 @@ package com.wimdupont.sxcybot.repository.osrs.dao; import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; -import org.hibernate.annotations.GenericGenerator; +import org.hibernate.annotations.UuidGenerator; @Entity public class OsrsHiscoreStat { @Id - @GeneratedValue(generator = "uuid") - @GenericGenerator(name = "uuid", strategy = "uuid") + @UuidGenerator private String id; private String name; private int orderValue; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties @@ -1,6 +1,6 @@ spring.datasource.url=jdbc:mariadb://localhost:3306/sxcybot spring.datasource.driver-class-name=org.mariadb.jdbc.Driver -spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect +#spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect #spring.jpa.generate-ddl=true #spring.jpa.hibernate.ddl-auto=update spring.flyway.url=jdbc:mariadb://localhost:3306/sxcybot