ing
This commit is contained in:
parent
c95612377e
commit
e451a5027e
|
@ -23,7 +23,7 @@ public class InfraHost extends Infra {
|
|||
private List<InfraHostDaemon> infraHostDaemons;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "META_TARGET_HOST_TYPE_ID", nullable = true)
|
||||
@JoinColumn(name = "META_TARGET_HOST_TYPE_ID", nullable = false)
|
||||
public MetaTargetHostType getMetaTargetHostType() {
|
||||
return metaTargetHostType;
|
||||
}
|
||||
|
|
|
@ -18,14 +18,14 @@ import java.util.List;
|
|||
@Table(name = "SENSOR", schema = "public")
|
||||
public class Sensor {
|
||||
private Long id;
|
||||
private Date createDate;
|
||||
private Target target;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private MetaSensorStatus metaSensorStatus;
|
||||
private Target target;
|
||||
private MetaCrawler metaCrawler;
|
||||
private String crawlerInputItems;
|
||||
private Integer itemCount = 0;
|
||||
private String displayName;
|
||||
private Date createDate;
|
||||
|
||||
// Transient property
|
||||
private List<MetaSensorDisplayItem> sensorItems;
|
||||
|
@ -40,16 +40,6 @@ public class Sensor {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Column(name = "DESCRIPTION", nullable = true, length = 50)
|
||||
public String getDescription() {
|
||||
return description;
|
||||
|
@ -117,6 +107,17 @@ public class Sensor {
|
|||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
@PrePersist
|
||||
void preInsert() {
|
||||
this.itemCount = 0;
|
||||
|
|
|
@ -15,109 +15,108 @@ import java.util.List;
|
|||
@Table(name = "TARGET", schema = "public")
|
||||
public class Target {
|
||||
|
||||
private Long id;
|
||||
private Date createDate;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private Integer sensorCount;
|
||||
private Infra infra;
|
||||
private Long id;
|
||||
private Infra infra;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private Integer sensorCount;
|
||||
private Date createDate;
|
||||
|
||||
// Transient property
|
||||
private List<Sensor> sensors;
|
||||
// Transient property
|
||||
private List<Sensor> sensors;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
@Column(name = "DISPLAY_NAME")
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
@Column(name = "DISPLAY_NAME")
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
@Column(name = "DESCRIPTION")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Column(name = "DESCRIPTION")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
@Column(name = "SENSOR_COUNT", nullable = false)
|
||||
public Integer getSensorCount() {
|
||||
return sensorCount;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public void setSensorCount(Integer sensorCount) {
|
||||
this.sensorCount = sensorCount;
|
||||
}
|
||||
|
||||
@Column(name = "SENSOR_COUNT", nullable = false)
|
||||
public Integer getSensorCount() {
|
||||
return sensorCount;
|
||||
}
|
||||
@Transient
|
||||
public List<Sensor> getSensors() {
|
||||
return sensors;
|
||||
}
|
||||
|
||||
public void setSensorCount(Integer sensorCount) {
|
||||
this.sensorCount = sensorCount;
|
||||
}
|
||||
public void setSensors(List<Sensor> sensors) {
|
||||
this.sensors = sensors;
|
||||
}
|
||||
|
||||
@Transient
|
||||
public List<Sensor> getSensors() {
|
||||
return sensors;
|
||||
}
|
||||
@PrePersist
|
||||
void preInsert() {
|
||||
this.sensorCount = 0;
|
||||
}
|
||||
|
||||
public void setSensors(List<Sensor> sensors) {
|
||||
this.sensors = sensors;
|
||||
}
|
||||
@OneToOne
|
||||
@JoinColumn(name = "INFRA_ID", nullable = false)
|
||||
public Infra getInfra() {
|
||||
return infra;
|
||||
}
|
||||
|
||||
@PrePersist
|
||||
void preInsert() {
|
||||
this.sensorCount = 0;
|
||||
}
|
||||
/**
|
||||
* @param infra the infra to set
|
||||
*/
|
||||
public void setInfra(Infra infra) {
|
||||
this.infra = infra;
|
||||
}
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "INFRA_ID", nullable = false)
|
||||
public Infra getInfra() {
|
||||
return infra;
|
||||
}
|
||||
// @ManyToOne
|
||||
// @JoinColumn(name = "PROBE_ID", nullable = false)
|
||||
// @OnDelete(action = OnDeleteAction.CASCADE)
|
||||
// public Probe getProbe() {
|
||||
// return probe;
|
||||
// }
|
||||
//
|
||||
// public void setProbe(Probe probe) {
|
||||
// this.probe = probe;
|
||||
// }
|
||||
//
|
||||
// @ManyToOne
|
||||
// @JoinColumn(name = "INFRA_ID", nullable = false)
|
||||
// public Infra getInfra() {
|
||||
// return infra;
|
||||
// }
|
||||
//
|
||||
// public void setInfra(Infra infra) {
|
||||
// this.infra = infra;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param infra the infra to set
|
||||
*/
|
||||
public void setInfra(Infra infra) {
|
||||
this.infra = infra;
|
||||
}
|
||||
|
||||
// @ManyToOne
|
||||
// @JoinColumn(name = "PROBE_ID", nullable = false)
|
||||
// @OnDelete(action = OnDeleteAction.CASCADE)
|
||||
// public Probe getProbe() {
|
||||
// return probe;
|
||||
// }
|
||||
//
|
||||
// public void setProbe(Probe probe) {
|
||||
// this.probe = probe;
|
||||
// }
|
||||
//
|
||||
// @ManyToOne
|
||||
// @JoinColumn(name = "INFRA_ID", nullable = false)
|
||||
// public Infra getInfra() {
|
||||
// return infra;
|
||||
// }
|
||||
//
|
||||
// public void setInfra(Infra infra) {
|
||||
// this.infra = infra;
|
||||
// }
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user