some model property changed

This commit is contained in:
insanity 2018-04-27 13:36:27 +09:00
parent becee0d2a4
commit ec87d642ec
3 changed files with 57 additions and 25 deletions

View File

@ -25,7 +25,7 @@ public class Probe {
private String cidr;
private Date authorizeDate;
private Member authorizeMember;
// private int targetCount = 0;
private int targetCount = 0;
public Probe() {
@ -145,15 +145,13 @@ public class Probe {
}
// @Column(name = "TARGET_COUNT", nullable = false)
// public int getTargetCount() {
// return targetCount;
// }
// public void setTargetCount(int targetCount) {
// this.targetCount = targetCount;
// }
@Column(name = "TARGET_COUNT", nullable = false)
public int getTargetCount() {
return targetCount;
}
public void setTargetCount(int targetCount) {
this.targetCount = targetCount;
}
}

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.model.sensor;
import com.loafle.overflow.model.meta.MetaCrawler;
import com.loafle.overflow.model.meta.MetaSensorDisplayItem;
import com.loafle.overflow.model.meta.MetaSensorStatus;
import com.loafle.overflow.model.target.Target;
import org.hibernate.annotations.OnDelete;
@ -8,6 +9,7 @@ import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
/**
* Created by root on 17. 6. 22.
@ -23,6 +25,10 @@ public class Sensor {
private MetaCrawler crawler;
private String crawlerInputItems;
private short itemCount = 0;
private String displayName;
// Transient property
private List<MetaSensorDisplayItem> sensorItems;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
@ -102,5 +108,24 @@ public class Sensor {
this.itemCount = itemCount;
}
@Column(name = "DISPLAY_NAME", nullable = false, length = 50)
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Transient
public List<MetaSensorDisplayItem> getSensorItems() {
return sensorItems;
}
public void setSensorItems(List<MetaSensorDisplayItem> sensorItems) {
this.sensorItems = sensorItems;
}
}

View File

@ -1,8 +1,9 @@
package com.loafle.overflow.model.target;
import javax.persistence.*;
import com.loafle.overflow.model.sensor.Sensor;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
@ -17,14 +18,11 @@ public class Target {
private Date createDate;
private String displayName;
private String description;
private int sensorCount = 0;
// Transient property
private List<Sensor> sensors;
/*
private long id;
private Date createDate;
private String displayName;
private String description;
*/
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
@ -65,6 +63,25 @@ public class Target {
}
@Column(name = "SENSOR_COUNT", nullable = false)
public int getSensorCount() {
return sensorCount;
}
public void setSensorCount(int sensorCount) {
this.sensorCount = sensorCount;
}
@Transient
public List<Sensor> getSensors() {
return sensors;
}
public void setSensors(List<Sensor> sensors) {
this.sensors = sensors;
}
// @ManyToOne
// @JoinColumn(name = "PROBE_ID", nullable = false)
// @OnDelete(action = OnDeleteAction.CASCADE)
@ -86,13 +103,5 @@ public class Target {
// this.infra = infra;
// }
@Transient
public List<Sensor> getSensors() {
return sensors;
}
public void setSensors(List<Sensor> sensors) {
this.sensors = sensors;
}
}