유저테이블 변경
This commit is contained in:
@@ -1,37 +1,81 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_user")
|
||||
public class UserEntity extends CommonDateEntity {
|
||||
public class UserEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "user_uid")
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_user_id_gen")
|
||||
@SequenceGenerator(name = "tb_user_id_gen", sequenceName = "tb_user_user_uid_seq", allocationSize = 1)
|
||||
@Column(name = "user_uid", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "user_nm")
|
||||
@Size(max = 255)
|
||||
@NotNull
|
||||
@Column(name = "user_nm", nullable = false)
|
||||
private String userNm;
|
||||
|
||||
@Column(name = "user_id")
|
||||
@Size(max = 255)
|
||||
@NotNull
|
||||
@Column(name = "user_id", nullable = false)
|
||||
private String userId;
|
||||
|
||||
@Column(name = "pswd")
|
||||
private String pswd; // TODO: 암호화
|
||||
@Size(max = 255)
|
||||
@NotNull
|
||||
@Column(name = "user_pw", nullable = false)
|
||||
private String userPw;
|
||||
|
||||
// @Enumerated(EnumType.STRING)
|
||||
private String state; // TODO: 추후 enum -> ACTIVE : 정상, LOCKED : 잠김, EXPIRED : 만료, WITHDRAWAL : 탈퇴
|
||||
@Size(max = 255)
|
||||
@NotNull
|
||||
@ColumnDefault("'ACTIVE'")
|
||||
@Column(name = "state", nullable = false)
|
||||
private String state;
|
||||
|
||||
@Column(name = "date_withdrawal")
|
||||
private ZonedDateTime dateWithdrawal;
|
||||
|
||||
private String userEmail;
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "created_dttm")
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "updated_dttm")
|
||||
private ZonedDateTime updatedDttm;
|
||||
|
||||
@Column(name = "created_uid")
|
||||
private Long createdUid;
|
||||
|
||||
@Column(name = "updated_uid")
|
||||
private Long updatedUid;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "user_email")
|
||||
private String userEmail;
|
||||
|
||||
@Size(max = 20)
|
||||
@NotNull
|
||||
@Column(name = "user_auth", nullable = false, length = 20)
|
||||
private String userAuth;
|
||||
|
||||
@Size(max = 255)
|
||||
@NotNull
|
||||
@Column(name = "emp_id", nullable = false)
|
||||
private String empId;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user