This commit is contained in:
snoop 2017-06-23 11:14:52 +09:00
parent 2c95216c92
commit 77412f30d6
3 changed files with 7 additions and 88 deletions

View File

@ -1,83 +0,0 @@
package com.loafle.overflow.models;
import com.loafle.overflow.module.domain.Domain;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "TBL_API_KEY", schema = "public", catalog = "postgres")
public class TblApiKey {
private long id;
private String apiKey;
private Date createDate;
private Domain domain;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "API_KEY", nullable = false, length = 50)
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable = false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domainId) {
this.domain = domain;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// TblApiKey tblApiKey = (TblApiKey) o;
//
// if (id != tblApiKey.id) return false;
// if (domainId != tblApiKey.domainId) return false;
// if (apiKey != null ? !apiKey.equals(tblApiKey.apiKey) : tblApiKey.apiKey != null) return false;
// if (createDate != null ? !createDate.equals(tblApiKey.createDate) : tblApiKey.createDate != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (int) (domainId ^ (domainId >>> 32));
// return result;
// }
}

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.module.domain;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
@ -11,7 +12,7 @@ import java.sql.Timestamp;
public class Domain {
private long id;
private String name;
private Timestamp createDate;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
@ -33,13 +34,13 @@ public class Domain {
this.name = name;
}
@Basic
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() {
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.module.member.dao;
import com.loafle.overflow.AppConfig;
import com.loafle.overflow.JdbcConfiguration;
import com.loafle.overflow.meta.MetaMemberStatus;
import com.loafle.overflow.module.member.model.Member;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -30,7 +31,7 @@ public class MemberDAOTest {
m.setPwSalt("salktttt");
m.setPhone("000-000-0000");
m.setEmail("insanity1@loafle.com");
m.setStatus(new MetaMemberStatus());
repo.save(m);
}
}