infra type string to int(child id)

This commit is contained in:
insanity 2017-08-21 19:43:20 +09:00
parent bc1105e98d
commit 9bea83bb2f
2 changed files with 23 additions and 22 deletions

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.target.model.Target;
@ -16,7 +17,7 @@ import java.util.Date;
@DiscriminatorColumn(name = "INFRA_TYPE", discriminatorType = DiscriminatorType.INTEGER)
public abstract class Infra {
private long id;
// private MetaInfraType infraType;
private MetaInfraType infraType;
// private long childId;
private Date createDate;
private Probe probe;
@ -96,15 +97,15 @@ public abstract class Infra {
this.id = id;
}
// @ManyToOne
// @JoinColumn(name = "TYPE_ID", nullable = false)
// public MetaInfraType getInfraType() {
// return infraType;
// }
//
// public void setInfraType(MetaInfraType infraType) {
// this.infraType = infraType;
// }
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInfraType getInfraType() {
return infraType;
}
public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType;
}
// @Basic
// @Column(name = "CHILD_ID", nullable = false)

View File

@ -406,18 +406,18 @@ INSERT INTO public.probe (authorize_date,cidr,create_date,description,display_na
INSERT INTO public.target (create_date,description,display_name) VALUES (
'2017-07-27 20:18:09.555','i am target','ghost target');
INSERT INTO public.infra (infra_type,create_date,probe_id,target_id) VALUES (
1,'2017-08-21 12:59:10.244',1,1);
INSERT INTO public.infra (infra_type,create_date,probe_id,target_id) VALUES (
3,'2017-08-21 13:05:24.883',1,1);
INSERT INTO public.infra (infra_type,create_date,probe_id,target_id) VALUES (
2,'2017-08-21 14:20:01.830',1,1);
INSERT INTO public.infra (infra_type,create_date,probe_id,target_id) VALUES (
7,'2017-08-21 14:24:26.525',1,1);
INSERT INTO public.infra (infra_type,create_date,probe_id,target_id) VALUES (
4,'2017-08-21 14:27:19.474',1,1);
INSERT INTO public.infra (infra_type,create_date,probe_id,target_id) VALUES (
5,'2017-08-21 14:28:48.761',1,1);
INSERT INTO public.infra (infra_type,create_date,type_id,probe_id,target_id) VALUES (
1,'2017-08-21 12:59:10.244',1,1,1);
INSERT INTO public.infra (infra_type,create_date,type_id,probe_id,target_id) VALUES (
3,'2017-08-21 13:05:24.883',3,1,1);
INSERT INTO public.infra (infra_type,create_date,type_id,probe_id,target_id) VALUES (
2,'2017-08-21 14:20:01.830',2,1,1);
INSERT INTO public.infra (infra_type,create_date,type_id,probe_id,target_id) VALUES (
7,'2017-08-21 14:24:26.525',7,1,1);
INSERT INTO public.infra (infra_type,create_date,type_id,probe_id,target_id) VALUES (
4,'2017-08-21 14:27:19.474',4,1,1);
INSERT INTO public.infra (infra_type,create_date,type_id,probe_id,target_id) VALUES (
5,'2017-08-21 14:28:48.761',5,1,1);
INSERT INTO public.infra_machine (meta,id) VALUES (