.test insert controller method

This commit is contained in:
jackdaw 2016-11-17 17:03:53 +09:00
parent 20aecd061d
commit 3cdc4b2ccf
3 changed files with 15 additions and 1 deletions

View File

@ -25,7 +25,7 @@ public class DiscoveryHistory
private Boolean result;
@JoinColumn
@OneToOne(cascade = CascadeType.ALL)
@OneToOne(mappedBy = "discovery",cascade = CascadeType.ALL)
private DiscoveryZone zone;
public DiscoveryZone getZone() {

View File

@ -64,6 +64,7 @@ public class DiscoveryPortController {
String ip = "3232235983";
z.setCidr(Long.parseLong(cidr));
z.setIp(Long.parseLong(ip));
z.setDiscovery(d);
d.setZone(z);
// host scan histories

View File

@ -1,5 +1,6 @@
package com.loafle.bridge.discoveryzone;
import com.loafle.bridge.discoveryhistory.DiscoveryHistory;
import com.loafle.bridge.discoveryhost.DiscoveryHost;
import javax.persistence.*;
@ -22,6 +23,10 @@ public class DiscoveryZone {
@Column(nullable=false)
private long cidr;
@JoinColumn
@OneToOne
private DiscoveryHistory discovery;
@OneToMany(mappedBy = "zone", cascade = CascadeType.ALL)
private List<HostScanHistory> hostScanHistories;
@ -67,4 +72,12 @@ public class DiscoveryZone {
public void setCidr(long cidr) {
this.cidr = cidr;
}
public DiscoveryHistory getDiscovery() {
return discovery;
}
public void setDiscovery(DiscoveryHistory discovery) {
this.discovery = discovery;
}
}