This commit is contained in:
crusader 2018-06-10 19:24:51 +09:00
parent c95612377e
commit e451a5027e
3 changed files with 102 additions and 102 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -16,11 +16,11 @@ import java.util.List;
public class Target {
private Long id;
private Date createDate;
private Infra infra;
private String displayName;
private String description;
private Integer sensorCount;
private Infra infra;
private Date createDate;
// Transient property
private List<Sensor> sensors;
@ -35,16 +35,6 @@ public class Target {
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 = "DISPLAY_NAME")
public String getDisplayName() {
return displayName;
@ -120,4 +110,13 @@ public class Target {
// 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;
}
}