.test insert controller method
This commit is contained in:
parent
20aecd061d
commit
3cdc4b2ccf
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user