infra id , date
  added vendortype
This commit is contained in:
snoop 2017-06-27 14:38:01 +09:00
parent 217b84ff62
commit f5491dcc7f
10 changed files with 33 additions and 14 deletions

View File

@ -47,7 +47,7 @@ public class Infra {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -11,8 +11,8 @@ import java.util.Date;
public class InfraHost { public class InfraHost {
private long id; private long id;
private InfraOS os; private InfraOS os;
private int ip; private long ip;
private int mac; private long mac;
private Date createDate; private Date createDate;
@Id @Id
@ -37,26 +37,26 @@ public class InfraHost {
@Basic @Basic
@Column(name = "IP", nullable = false) @Column(name = "IP", nullable = false)
public int getIp() { public long getIp() {
return ip; return ip;
} }
public void setIp(int ip) { public void setIp(long ip) {
this.ip = ip; this.ip = ip;
} }
@Basic @Basic
@Column(name = "MAC", nullable = false) @Column(name = "MAC", nullable = false)
public int getMac() { public long getMac() {
return mac; return mac;
} }
public void setMac(int mac) { public void setMac(long mac) {
this.mac = mac; this.mac = mac;
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -47,7 +47,7 @@ public class InfraMachine {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -48,7 +48,7 @@ public class InfraOS {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -45,7 +45,7 @@ public class InfraOSApplication {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -45,7 +45,7 @@ public class InfraOSDaemon {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -40,7 +40,7 @@ public class InfraOSPort {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -70,7 +70,7 @@ public class InfraService {
} }
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }

View File

@ -107,6 +107,8 @@ INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
41,'2017-06-26 20:59:36.385','WMI',7); 41,'2017-06-26 20:59:36.385','WMI',7);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES ( INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
42,'2017-06-26 20:59:36.414','SNMP_V2',7); 42,'2017-06-26 20:59:36.414','SNMP_V2',7);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
43,'2017-06-27 14:32:12.506','UNKNOWN',7);
INSERT INTO public.meta_crawler (id,create_date,description,"name") VALUES ( INSERT INTO public.meta_crawler (id,create_date,description,"name") VALUES (
1,'2017-06-25 17:00:43.869','WMI','WMI_CRAWLER'); 1,'2017-06-25 17:00:43.869','WMI','WMI_CRAWLER');

View File

@ -25,6 +25,23 @@ public class MetaInfraVendorDAOTest {
@Autowired @Autowired
private MetaInfraVendorDAO metaInfraVendorDAO; private MetaInfraVendorDAO metaInfraVendorDAO;
@Test
public void createOne() {
int startIdx = 43;
MetaInfraType typeApp = new MetaInfraType();
typeApp.setId(7);
MetaInfraVendor vendor = new MetaInfraVendor();
vendor.setId(startIdx);
vendor.setMetaInfraType(typeApp);
vendor.setName("UNKNOWN");
this.metaInfraVendorDAO.save(vendor);
}
@Test @Test
public void create() { public void create() {