This commit is contained in:
snoop 2017-06-22 21:15:30 +09:00
parent fc763c645e
commit 8d5815ecbb
4 changed files with 134 additions and 105 deletions

View File

@ -1,7 +1,10 @@
package com.loafle.overflow.models; package com.loafle.overflow.models;
import com.loafle.overflow.module.domain.Domain;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Date;
/** /**
* Created by root on 17. 6. 22. * Created by root on 17. 6. 22.
@ -11,11 +14,11 @@ import java.sql.Timestamp;
public class TblApiKey { public class TblApiKey {
private long id; private long id;
private String apiKey; private String apiKey;
private Timestamp createDate; private Date createDate;
private long domainId; private Domain domain;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -24,7 +27,7 @@ public class TblApiKey {
this.id = id; this.id = id;
} }
@Basic
@Column(name = "API_KEY", nullable = false, length = 50) @Column(name = "API_KEY", nullable = false, length = 50)
public String getApiKey() { public String getApiKey() {
return apiKey; return apiKey;
@ -34,47 +37,47 @@ public class TblApiKey {
this.apiKey = apiKey; this.apiKey = apiKey;
} }
@Basic @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false) @Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
public void setCreateDate(Timestamp createDate) { public void setCreateDate(Date createDate) {
this.createDate = createDate; this.createDate = createDate;
} }
@Basic @ManyToOne
@Column(name = "DOMAIN_ID", nullable = false) @JoinColumn(name = "DOMAIN_ID", nullable = false)
public long getDomainId() { public Domain getDomain() {
return domainId; return domain;
} }
public void setDomainId(long domainId) { public void setDomain(Domain domainId) {
this.domainId = domainId; this.domain = domain;
} }
@Override // @Override
public boolean equals(Object o) { // public boolean equals(Object o) {
if (this == o) return true; // if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; // if (o == null || getClass() != o.getClass()) return false;
//
TblApiKey tblApiKey = (TblApiKey) o; // TblApiKey tblApiKey = (TblApiKey) o;
//
if (id != tblApiKey.id) return false; // if (id != tblApiKey.id) return false;
if (domainId != tblApiKey.domainId) return false; // if (domainId != tblApiKey.domainId) return false;
if (apiKey != null ? !apiKey.equals(tblApiKey.apiKey) : tblApiKey.apiKey != null) 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; // if (createDate != null ? !createDate.equals(tblApiKey.createDate) : tblApiKey.createDate != null) return false;
//
return true; // return true;
} // }
//
@Override // @Override
public int hashCode() { // public int hashCode() {
int result = (int) (id ^ (id >>> 32)); // int result = (int) (id ^ (id >>> 32));
result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0); // result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0); // result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + (int) (domainId ^ (domainId >>> 32)); // result = 31 * result + (int) (domainId ^ (domainId >>> 32));
return result; // return result;
} // }
} }

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.models;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Date;
/** /**
* Created by root on 17. 6. 22. * Created by root on 17. 6. 22.
@ -10,10 +11,10 @@ import java.sql.Timestamp;
@Table(name = "TBL_HISTORY", schema = "public", catalog = "postgres") @Table(name = "TBL_HISTORY", schema = "public", catalog = "postgres")
public class TblHistory { public class TblHistory {
private long id; private long id;
private Timestamp createDate; private Date createDate;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -22,13 +23,13 @@ public class TblHistory {
this.id = id; this.id = id;
} }
@Basic @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false) @Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
public void setCreateDate(Timestamp createDate) { public void setCreateDate(Date createDate) {
this.createDate = createDate; this.createDate = createDate;
} }

View File

@ -1,7 +1,11 @@
package com.loafle.overflow.models; package com.loafle.overflow.models;
import com.loafle.overflow.meta.MetaProbeTaskType;
import com.loafle.overflow.module.probe.model.Probe;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Date;
/** /**
* Created by root on 17. 6. 22. * Created by root on 17. 6. 22.
@ -10,17 +14,17 @@ import java.sql.Timestamp;
@Table(name = "TBL_PROBE_TASK", schema = "public", catalog = "postgres") @Table(name = "TBL_PROBE_TASK", schema = "public", catalog = "postgres")
public class TblProbeTask { public class TblProbeTask {
private long id; private long id;
private short typeId; private MetaProbeTaskType metaProbeTaskType;
private long probeId; private Probe probe;
private String data; private String data;
private Timestamp createDate; private Date createDate;
private Timestamp sendDate; private Date sendDate;
private Timestamp startDate; private Date startDate;
private Timestamp endDate; private Date endDate;
private Boolean succeed; private Boolean succeed;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -29,26 +33,46 @@ public class TblProbeTask {
this.id = id; this.id = id;
} }
@Basic @ManyToOne
@Column(name = "TYPE_ID", nullable = false) @JoinColumn(name = "TYPE_ID", nullable = false)
public short getTypeId() { public MetaProbeTaskType getMetaProbeTaskType() {
return typeId; return metaProbeTaskType;
} }
public void setTypeId(short typeId) { public void setMetaProbeTaskType(MetaProbeTaskType metaProbeTaskType) {
this.typeId = typeId; this.metaProbeTaskType = metaProbeTaskType;
} }
@Basic @ManyToOne
@Column(name = "PROBE_ID", nullable = false) @JoinColumn(name = "PROBE_ID", nullable = false)
public long getProbeId() { public Probe getProbe() {
return probeId; return probe;
} }
public void setProbeId(long probeId) { public void setProbe(Probe probe) {
this.probeId = probeId; this.probe = probe;
} }
// @Basic
// @Column(name = "TYPE_ID", nullable = false)
// public short getTypeId() {
// return typeId;
// }
//
// public void setTypeId(short typeId) {
// this.typeId = typeId;
// }
//
// @Basic
// @Column(name = "PROBE_ID", nullable = false)
// public long getProbeId() {
// return probeId;
// }
//
// public void setProbeId(long probeId) {
// this.probeId = probeId;
// }
@Basic @Basic
@Column(name = "DATA", nullable = true, length = 255) @Column(name = "DATA", nullable = true, length = 255)
public String getData() { public String getData() {
@ -61,41 +85,41 @@ public class TblProbeTask {
@Basic @Basic
@Column(name = "CREATE_DATE", nullable = false) @Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
public void setCreateDate(Timestamp createDate) { public void setCreateDate(Date createDate) {
this.createDate = createDate; this.createDate = createDate;
} }
@Basic @Basic
@Column(name = "SEND_DATE", nullable = true) @Column(name = "SEND_DATE", nullable = true)
public Timestamp getSendDate() { public Date getSendDate() {
return sendDate; return sendDate;
} }
public void setSendDate(Timestamp sendDate) { public void setSendDate(Date sendDate) {
this.sendDate = sendDate; this.sendDate = sendDate;
} }
@Basic @Basic
@Column(name = "START_DATE", nullable = true) @Column(name = "START_DATE", nullable = true)
public Timestamp getStartDate() { public Date getStartDate() {
return startDate; return startDate;
} }
public void setStartDate(Timestamp startDate) { public void setStartDate(Date startDate) {
this.startDate = startDate; this.startDate = startDate;
} }
@Basic @Basic
@Column(name = "END_DATE", nullable = true) @Column(name = "END_DATE", nullable = true)
public Timestamp getEndDate() { public Date getEndDate() {
return endDate; return endDate;
} }
public void setEndDate(Timestamp endDate) { public void setEndDate(Date endDate) {
this.endDate = endDate; this.endDate = endDate;
} }
@ -109,37 +133,37 @@ public class TblProbeTask {
this.succeed = succeed; this.succeed = succeed;
} }
@Override // @Override
public boolean equals(Object o) { // public boolean equals(Object o) {
if (this == o) return true; // if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; // if (o == null || getClass() != o.getClass()) return false;
//
TblProbeTask that = (TblProbeTask) o; // TblProbeTask that = (TblProbeTask) o;
//
if (id != that.id) return false; // if (id != that.id) return false;
if (typeId != that.typeId) return false; // if (typeId != that.typeId) return false;
if (probeId != that.probeId) return false; // if (probeId != that.probeId) return false;
if (data != null ? !data.equals(that.data) : that.data != null) return false; // if (data != null ? !data.equals(that.data) : that.data != null) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false; // if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
if (sendDate != null ? !sendDate.equals(that.sendDate) : that.sendDate != null) return false; // if (sendDate != null ? !sendDate.equals(that.sendDate) : that.sendDate != null) return false;
if (startDate != null ? !startDate.equals(that.startDate) : that.startDate != null) return false; // if (startDate != null ? !startDate.equals(that.startDate) : that.startDate != null) return false;
if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false; // if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
if (succeed != null ? !succeed.equals(that.succeed) : that.succeed != null) return false; // if (succeed != null ? !succeed.equals(that.succeed) : that.succeed != null) return false;
//
return true; // return true;
} // }
//
@Override // @Override
public int hashCode() { // public int hashCode() {
int result = (int) (id ^ (id >>> 32)); // int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) typeId; // result = 31 * result + (int) typeId;
result = 31 * result + (int) (probeId ^ (probeId >>> 32)); // result = 31 * result + (int) (probeId ^ (probeId >>> 32));
result = 31 * result + (data != null ? data.hashCode() : 0); // result = 31 * result + (data != null ? data.hashCode() : 0);
result = 31 * result + (createDate != null ? createDate.hashCode() : 0); // result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + (sendDate != null ? sendDate.hashCode() : 0); // result = 31 * result + (sendDate != null ? sendDate.hashCode() : 0);
result = 31 * result + (startDate != null ? startDate.hashCode() : 0); // result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
result = 31 * result + (endDate != null ? endDate.hashCode() : 0); // result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
result = 31 * result + (succeed != null ? succeed.hashCode() : 0); // result = 31 * result + (succeed != null ? succeed.hashCode() : 0);
return result; // return result;
} // }
} }

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.models;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Date;
/** /**
* Created by root on 17. 6. 22. * Created by root on 17. 6. 22.
@ -10,10 +11,10 @@ import java.sql.Timestamp;
@Table(name = "TBL_UI_WEBSOCKET", schema = "public", catalog = "postgres") @Table(name = "TBL_UI_WEBSOCKET", schema = "public", catalog = "postgres")
public class TblUiWebsocket { public class TblUiWebsocket {
private long id; private long id;
private Timestamp createDate; private Date createDate;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -24,11 +25,11 @@ public class TblUiWebsocket {
@Basic @Basic
@Column(name = "CREATE_DATE", nullable = true) @Column(name = "CREATE_DATE", nullable = true)
public Timestamp getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
public void setCreateDate(Timestamp createDate) { public void setCreateDate(Date createDate) {
this.createDate = createDate; this.createDate = createDate;
} }