Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor/#104] : 테이블명 및 컬럼명 명시적으로 작성 #108

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "ability")
public class Ability extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "ability_id", nullable = false)
private Long abilityId;

@Column(nullable = false)
@Column(name = "keyword", nullable = false)
@Enumerated(EnumType.STRING)
private Keyword keyword;

@Column(nullable = false, length = 300)
@Column(name = "content", nullable = false, length = 300)
private String content;

@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "analysis")
public class Analysis extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "analysis_id", nullable = false)
private Long analysisId;

@Column(nullable = false, length = 500)
@Column(name = "content", nullable = false, length = 500)
private String content;

@Column(nullable = false, length = 300)
@Column(name = "comment", nullable = false, length = 300)
private String comment;

@OneToOne(cascade = CascadeType.ALL, orphanRemoval = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "chat")
public class Chat extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "chat_id", nullable = false)
private Long chatId;

@Column(nullable = false)
@Column(name = "author", nullable = false)
private Integer author; // 0(user), 1(ai)

@Column(nullable = false, length = 500)
@Column(name = "content", nullable = false, length = 500)
private String content;

@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "chat_room")
public class ChatRoom extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "chat_room_id", nullable = false)
private Long chatRoomId;

@OneToMany(mappedBy = "chatRoom", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "folder")
public class Folder extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "folder_id", nullable = false)
private Long folderId;

@Column(nullable = false, length = 15)
@Column(name = "title", nullable = false, length = 15)
private String title;

@OneToMany(mappedBy = "folder", cascade = CascadeType.ALL, orphanRemoval = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
@Getter @Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "record")
public class Record extends BaseEntity {

@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "record_id",nullable = false)
private Long recordId;

@Column(nullable = false)
@Column(name = "type", nullable = false)
@Enumerated(EnumType.STRING)
private RecordType type;

@Column(length = 50)
@Column(name = "title", length = 50)
private String title;

@Column(nullable = false, length = 500)
@Column(name = "content", nullable = false, length = 500)
private String content;

@ManyToOne(fetch = FetchType.LAZY)
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/corecord/dev/domain/user/domain/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,29 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "user")
public class User extends BaseEntity {

@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Column(name = "user_id", nullable = false)
private Long userId;

@Column(nullable = false)
@Column(name = "provider_id", nullable = false)
private String providerId;

@Setter
@Column(nullable = false)
@Column(name = "nick_name", nullable = false)
private String nickName;

@Setter
@Enumerated(EnumType.STRING)
@Column(nullable = false)
@Column(name = "status", nullable = false)
private Status status;

@Column
@Column(name = "tmp_chat")
private Long tmpChat;

@Column
@Column(name = "tmp_memo")
private Long tmpMemo;

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
Expand Down