This commit is contained in:
geek 2018-05-04 15:29:14 +09:00
parent 5b21689fbd
commit c24d63c734
3 changed files with 56 additions and 21 deletions

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.model.email; package com.loafle.overflow.model.email;
import com.loafle.overflow.model.member.Member; import com.loafle.overflow.model.member.Member;
import com.loafle.overflow.model.meta.MetaEmailStatus;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
@ -16,7 +17,7 @@ public class EmailAuth {
private Date createDate; private Date createDate;
private Date authConfirmDate; private Date authConfirmDate;
private Member member; private Member member;
private String emailType; private MetaEmailStatus emailStatus;
@Id @Id
@GeneratedValue(strategy= GenerationType.IDENTITY) @GeneratedValue(strategy= GenerationType.IDENTITY)
@ -68,13 +69,13 @@ public class EmailAuth {
this.member = member; this.member = member;
} }
@Basic @ManyToOne
@Column(name = "EMAIL_TYPE", nullable = true, length = 10) @JoinColumn(name = "STATUS", nullable = false)
public String getEmailType() { public MetaEmailStatus getEmailStatus() {
return emailType; return emailStatus;
} }
public void setEmailType(String emailType) { public void setEmailStatus(MetaEmailStatus emailStatus) {
this.emailType = emailType; this.emailStatus = emailStatus;
} }
} }

View File

@ -1,14 +0,0 @@
package com.loafle.overflow.model.email.type;
public enum EmailType {
SIGNUP("SIGNUP"),
PASSWORD("PASSWORD");
private String stringValue;
EmailType(String string) {stringValue = string;}
@Override
public String toString() {
return stringValue;
}
}

View File

@ -0,0 +1,48 @@
package com.loafle.overflow.model.meta;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name = "META_EMAIL_STATUS", schema = "public")
public class MetaEmailStatus {
private int id;
private String name;
private Date createDate;
public MetaEmailStatus(){}
public MetaEmailStatus(int id) {
this.id = id;
}
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name="CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}