From 9e2e2732d67ba0088b56804f7193e95b4ae46f22 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 1 Jul 2024 02:46:50 +0300 Subject: JPA: cleanup column definitions from entities --- src/main/java/com/juick/data/entities/EmailEntity.java | 2 +- src/main/java/com/juick/data/entities/MessageEntity.java | 2 +- src/main/java/com/juick/data/entities/ReplyEntity.java | 4 ++-- src/main/java/com/juick/data/entities/TagEntity.java | 2 +- src/main/java/com/juick/data/entities/TagNameEntity.java | 2 +- src/main/java/com/juick/data/entities/TelegramEntity.java | 2 +- src/main/java/com/juick/data/entities/TextEntity.java | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/juick/data/entities/EmailEntity.java b/src/main/java/com/juick/data/entities/EmailEntity.java index 566a9654..4e71adc5 100644 --- a/src/main/java/com/juick/data/entities/EmailEntity.java +++ b/src/main/java/com/juick/data/entities/EmailEntity.java @@ -23,7 +23,7 @@ import jakarta.persistence.*; @Table(name = "emails") public class EmailEntity extends BaseUserPropertyEntity { @Id - @Column(name = "email", columnDefinition = "char(64)") + @Column(name = "email") @GeneratedValue(strategy = GenerationType.AUTO) private String email; diff --git a/src/main/java/com/juick/data/entities/MessageEntity.java b/src/main/java/com/juick/data/entities/MessageEntity.java index 8fa751c9..416334d6 100644 --- a/src/main/java/com/juick/data/entities/MessageEntity.java +++ b/src/main/java/com/juick/data/entities/MessageEntity.java @@ -27,7 +27,7 @@ import java.util.Set; @Table(name = "messages") public class MessageEntity implements Serializable { @Id - @Column(name = "message_id", columnDefinition = "int(10) unsigned not null auto_increment") + @Column(name = "message_id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "message") diff --git a/src/main/java/com/juick/data/entities/ReplyEntity.java b/src/main/java/com/juick/data/entities/ReplyEntity.java index 102d9848..e7f3d053 100644 --- a/src/main/java/com/juick/data/entities/ReplyEntity.java +++ b/src/main/java/com/juick/data/entities/ReplyEntity.java @@ -23,10 +23,10 @@ import jakarta.persistence.*; @Table(name = "replies") public class ReplyEntity extends BaseMessagePropertyEntity { @Id - @Column(name = "reply_id", columnDefinition = "smallint") + @Column(name = "reply_id") @GeneratedValue(strategy = GenerationType.AUTO) private Long replyId; - @Column(name = "txt", columnDefinition = "clob") + @Column(name = "txt") private String text; diff --git a/src/main/java/com/juick/data/entities/TagEntity.java b/src/main/java/com/juick/data/entities/TagEntity.java index 5dddb074..6fbc6987 100644 --- a/src/main/java/com/juick/data/entities/TagEntity.java +++ b/src/main/java/com/juick/data/entities/TagEntity.java @@ -23,7 +23,7 @@ import jakarta.persistence.*; @Table(name = "messages_tags") public class TagEntity extends BaseMessagePropertyEntity { @Id - @Column(name = "tag_id", columnDefinition = "int(10)") + @Column(name = "tag_id") @GeneratedValue(strategy = GenerationType.AUTO) private int id; @OneToOne(cascade = CascadeType.ALL) diff --git a/src/main/java/com/juick/data/entities/TagNameEntity.java b/src/main/java/com/juick/data/entities/TagNameEntity.java index 96bcea8e..98d3bbea 100644 --- a/src/main/java/com/juick/data/entities/TagNameEntity.java +++ b/src/main/java/com/juick/data/entities/TagNameEntity.java @@ -26,7 +26,7 @@ public class TagNameEntity { @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "tag_id") private int id; - @Column(name = "name", columnDefinition = "varchar(70)") + @Column(name = "name") private String name; public int getId() { diff --git a/src/main/java/com/juick/data/entities/TelegramEntity.java b/src/main/java/com/juick/data/entities/TelegramEntity.java index b5b4d8ef..a592f635 100644 --- a/src/main/java/com/juick/data/entities/TelegramEntity.java +++ b/src/main/java/com/juick/data/entities/TelegramEntity.java @@ -23,7 +23,7 @@ import jakarta.persistence.*; @Table(name = "telegram") public class TelegramEntity extends BaseUserPropertyEntity { @Id - @Column(name = "tg_id", columnDefinition = "bigint(20)") + @Column(name = "tg_id") @GeneratedValue(strategy = GenerationType.AUTO) private Long identifier; diff --git a/src/main/java/com/juick/data/entities/TextEntity.java b/src/main/java/com/juick/data/entities/TextEntity.java index 57a1722f..c96adb96 100644 --- a/src/main/java/com/juick/data/entities/TextEntity.java +++ b/src/main/java/com/juick/data/entities/TextEntity.java @@ -25,11 +25,11 @@ import java.io.Serializable; public class TextEntity implements Serializable { @Id - @Column(name = "message_id", columnDefinition = "int(10)") + @Column(name = "message_id") @GeneratedValue(strategy = GenerationType.AUTO) private int id; - @Column(name = "txt", columnDefinition = "clob") + @Column(name = "txt") private String text; public String getText() { -- cgit v1.2.3