fixed
zone , hostscan
This commit is contained in:
parent
6f032947c2
commit
df5a93e878
|
@ -20,7 +20,7 @@ public class DiscoveryZone {
|
||||||
@Column(nullable=false)
|
@Column(nullable=false)
|
||||||
private long cidr;
|
private long cidr;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "zone")
|
@OneToMany(mappedBy = "zone", cascade = CascadeType.ALL)
|
||||||
private List<HostScanHistory> hostScanHistories;
|
private List<HostScanHistory> hostScanHistories;
|
||||||
|
|
||||||
public List<HostScanHistory> getHostScanHistories() {
|
public List<HostScanHistory> getHostScanHistories() {
|
||||||
|
|
|
@ -17,13 +17,13 @@ public class HostScanHistory {
|
||||||
@Column(nullable=false)
|
@Column(nullable=false)
|
||||||
private long ip;
|
private long ip;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, updatable = false)
|
@Column(nullable = false, updatable = false)
|
||||||
private Date createDate;
|
private Date createDate;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, updatable = false)
|
@Column(nullable = false, updatable = false)
|
||||||
private Date sendDate;
|
private Date sendDate;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, updatable = false)
|
@Column(nullable = false, updatable = false)
|
||||||
private Date resultDate;
|
private Date resultDate;
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class DiscoveryZoneRepositoryTest {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Before
|
// @Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
DiscoveryZone discoveryZone = new DiscoveryZone();
|
DiscoveryZone discoveryZone = new DiscoveryZone();
|
||||||
|
|
||||||
|
@ -70,10 +70,10 @@ public class DiscoveryZoneRepositoryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Transactional
|
// @Transactional
|
||||||
public void InsertHostHistory() throws Exception {
|
public void InsertHostHistory() throws Exception {
|
||||||
|
|
||||||
DiscoveryZone zone = discoveryZoneRepository.findOne((long)1);
|
DiscoveryZone zone = discoveryZoneRepository.findAll().get(0);
|
||||||
|
|
||||||
HostScanHistory hostScanHistory = null;
|
HostScanHistory hostScanHistory = null;
|
||||||
|
|
||||||
|
@ -110,12 +110,12 @@ public class DiscoveryZoneRepositoryTest {
|
||||||
|
|
||||||
DiscoveryZone zzzz = discoveryZoneRepository.findOne(zone.getId());
|
DiscoveryZone zzzz = discoveryZoneRepository.findOne(zone.getId());
|
||||||
|
|
||||||
if(zzzz.getHostScanHistories() != null && zzzz.getHostScanHistories().size() > 0) {
|
// if(zzzz.getHostScanHistories() != null && zzzz.getHostScanHistories().size() > 0) {
|
||||||
System.out.println("zzzz. = " + zzzz.getHostScanHistories().size());
|
// System.out.println("zzzz. = " + zzzz.getHostScanHistories().size());
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
System.out.println("TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
|
// System.out.println("TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user