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