diff options
author | Vitaly Takmazov | 2024-07-01 02:46:50 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-07-01 02:46:50 +0300 |
commit | 9e2e2732d67ba0088b56804f7193e95b4ae46f22 (patch) | |
tree | 930fbdca73d1534b644c08e5f96195c9607449eb /src/main/java | |
parent | 0fe8ba86c60a96b4e67196074ba4ec9944e34d5d (diff) |
JPA: cleanup column definitions from entities
Diffstat (limited to 'src/main/java')
7 files changed, 9 insertions, 9 deletions
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() { |