Merge remote-tracking branch 'origin/master'

This commit is contained in:
snoop 2017-06-22 20:22:33 +09:00
commit 5875b72835
4 changed files with 58 additions and 127 deletions

View File

@ -1,5 +1,7 @@
package com.loafle.overflow.module.infra; package com.loafle.overflow.module.infra;
import com.loafle.overflow.meta.MetaInfraType;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -10,12 +12,12 @@ import java.sql.Timestamp;
@Table(name = "TBL_INFRA", schema = "public", catalog = "postgres") @Table(name = "TBL_INFRA", schema = "public", catalog = "postgres")
public class Infra { public class Infra {
private long id; private long id;
private int typeId; private MetaInfraType type;
private long childId; private long childId;
private Timestamp createDate; private Timestamp createDate;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -24,14 +26,14 @@ public class Infra {
this.id = id; this.id = id;
} }
@Basic @ManyToOne
@Column(name = "TYPE_ID", nullable = false) @JoinColumn(name = "TYPE_ID", nullable = false)
public int getTypeId() { public MetaInfraType getType() {
return typeId; return type;
} }
public void setTypeId(int typeId) { public void setTypeId(MetaInfraType type) {
this.typeId = typeId; this.type = type;
} }
@Basic @Basic
@ -45,7 +47,7 @@ public class Infra {
} }
@Basic @Basic
@Column(name = "CREATE_DATE", nullable = false) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() { public Timestamp getCreateDate() {
return createDate; return createDate;
} }
@ -54,27 +56,4 @@ public class Infra {
this.createDate = createDate; this.createDate = createDate;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Infra tblInfra = (Infra) o;
if (id != tblInfra.id) return false;
if (typeId != tblInfra.typeId) return false;
if (childId != tblInfra.childId) return false;
if (createDate != null ? !createDate.equals(tblInfra.createDate) : tblInfra.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + typeId;
result = 31 * result + (int) (childId ^ (childId >>> 32));
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
} }

View File

@ -101,7 +101,7 @@ public class Member {
this.createDate = createDate; this.createDate = createDate;
} }
@ManyToMany @ManyToOne
@JoinColumn(name = "STATUS_ID", nullable = false) @JoinColumn(name = "STATUS_ID", nullable = false)
public MetaMemberStatus getStatus() { public MetaMemberStatus getStatus() {
return status; return status;

View File

@ -1,5 +1,8 @@
package com.loafle.overflow.module.sensor.model; package com.loafle.overflow.module.sensor.model;
import com.loafle.overflow.meta.MetaCrawler;
import com.loafle.overflow.module.target.model.Target;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -13,12 +16,12 @@ public class Sensor {
private Timestamp createDate; private Timestamp createDate;
private String desc; private String desc;
private String status; private String status;
private long targetId; private Target target;
private short crawlerId; private MetaCrawler crawler;
private String crawelrInputItems; private String crawlerInputItems;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -28,7 +31,7 @@ public class Sensor {
} }
@Basic @Basic
@Column(name = "CREATE_DATE", nullable = false) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() { public Timestamp getCreateDate() {
return createDate; return createDate;
} }
@ -57,64 +60,34 @@ public class Sensor {
this.status = status; this.status = status;
} }
@Basic @ManyToOne
@Column(name = "TARGET_ID", nullable = false) @JoinColumn(name = "TARGET_ID", nullable = false)
public long getTargetId() { public Target getTarget() {
return targetId; return target;
} }
public void setTargetId(long targetId) { public void setTarget(Target target) {
this.targetId = targetId; this.target = target;
} }
@Basic @ManyToOne
@Column(name = "CRAWLER_ID", nullable = false) @JoinColumn(name = "CRAWLER_ID", nullable = false)
public short getCrawlerId() { public MetaCrawler getCrawler() {
return crawlerId; return crawler;
} }
public void setCrawlerId(short crawlerId) { public void setCrawler(MetaCrawler crawler) {
this.crawlerId = crawlerId; this.crawler = crawler;
} }
@Basic @Basic
@Column(name = "CRAWELR_INPUT_ITEMS", nullable = true, length = 50) @Column(name = "CRAWELR_INPUT_ITEMS", nullable = true, length = 50)
public String getCrawelrInputItems() { public String getcrawlerInputItems() {
return crawelrInputItems; return crawlerInputItems;
} }
public void setCrawelrInputItems(String crawelrInputItems) { public void setcrawlerInputItems(String crawlerInputItems) {
this.crawelrInputItems = crawelrInputItems; this.crawlerInputItems = crawlerInputItems;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Sensor tblSensor = (Sensor) o;
if (id != tblSensor.id) return false;
if (targetId != tblSensor.targetId) return false;
if (crawlerId != tblSensor.crawlerId) return false;
if (createDate != null ? !createDate.equals(tblSensor.createDate) : tblSensor.createDate != null) return false;
if (desc != null ? !desc.equals(tblSensor.desc) : tblSensor.desc != null) return false;
if (status != null ? !status.equals(tblSensor.status) : tblSensor.status != null) return false;
if (crawelrInputItems != null ? !crawelrInputItems.equals(tblSensor.crawelrInputItems) : tblSensor.crawelrInputItems != null)
return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
result = 31 * result + (desc != null ? desc.hashCode() : 0);
result = 31 * result + (status != null ? status.hashCode() : 0);
result = 31 * result + (int) (targetId ^ (targetId >>> 32));
result = 31 * result + (int) crawlerId;
result = 31 * result + (crawelrInputItems != null ? crawelrInputItems.hashCode() : 0);
return result;
}
} }

View File

@ -1,5 +1,7 @@
package com.loafle.overflow.module.sensor.model; package com.loafle.overflow.module.sensor.model;
import com.loafle.overflow.meta.MetaSensorItem;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Timestamp; import java.sql.Timestamp;
@ -10,12 +12,12 @@ import java.sql.Timestamp;
@Table(name = "TBL_SENSOR_ITEM", schema = "public", catalog = "postgres") @Table(name = "TBL_SENSOR_ITEM", schema = "public", catalog = "postgres")
public class SensorItem { public class SensorItem {
private long id; private long id;
private long sensorId; private Sensor sensor;
private long itemId; private MetaSensorItem item;
private Timestamp createDate; private Timestamp createDate;
@Id @Id
@Column(name = "ID", nullable = false) @GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() { public long getId() {
return id; return id;
} }
@ -24,28 +26,28 @@ public class SensorItem {
this.id = id; this.id = id;
} }
@Basic @ManyToOne
@Column(name = "SENSOR_ID", nullable = false) @JoinColumn(name = "SENSOR_ID", nullable = false)
public long getSensorId() { public Sensor getSensor() {
return sensorId; return this.sensor;
} }
public void setSensorId(long sensorId) { public void setSensor(Sensor sensor) {
this.sensorId = sensorId; this.sensor = sensor;
}
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getItem() {
return item;
}
public void setItem(MetaSensorItem item) {
this.item = item;
} }
@Basic @Basic
@Column(name = "ITEM_ID", nullable = false) @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public long getItemId() {
return itemId;
}
public void setItemId(long itemId) {
this.itemId = itemId;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false)
public Timestamp getCreateDate() { public Timestamp getCreateDate() {
return createDate; return createDate;
} }
@ -54,27 +56,4 @@ public class SensorItem {
this.createDate = createDate; this.createDate = createDate;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SensorItem that = (SensorItem) o;
if (id != that.id) return false;
if (sensorId != that.sensorId) return false;
if (itemId != that.itemId) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (int) (sensorId ^ (sensorId >>> 32));
result = 31 * result + (int) (itemId ^ (itemId >>> 32));
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
} }