host jpa option edited
This commit is contained in:
parent
14cdf606cd
commit
8bafd55e71
|
@ -67,6 +67,7 @@ public class DiscoveryHost {
|
||||||
|
|
||||||
|
|
||||||
public DiscoveryHost(){}
|
public DiscoveryHost(){}
|
||||||
|
|
||||||
public DiscoveryHost(long ip, long mac){
|
public DiscoveryHost(long ip, long mac){
|
||||||
this.ip = ip;
|
this.ip = ip;
|
||||||
this.mac = mac;
|
this.mac = mac;
|
||||||
|
|
|
@ -1,7 +1,23 @@
|
||||||
package com.loafle.bridge.discoveryhost;
|
package com.loafle.bridge.discoveryhost;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by root on 16. 11. 15.
|
* Created by root on 16. 11. 15.
|
||||||
*/
|
*/
|
||||||
|
@RestController
|
||||||
public class DiscoveryHostController {
|
public class DiscoveryHostController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DiscoveryHostRepository repository;
|
||||||
|
|
||||||
|
@RequestMapping(value ="/hostTest")
|
||||||
|
@Transactional
|
||||||
|
public void testHost() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class PortScanHistory {
|
||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn
|
@JoinColumn(name = "HOST_ID", nullable = false)
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private DiscoveryHost host;
|
private DiscoveryHost host;
|
||||||
|
|
||||||
|
@ -44,10 +44,10 @@ public class PortScanHistory {
|
||||||
@Column(nullable = true)
|
@Column(nullable = true)
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Column(nullable = true)
|
@Column(nullable = false)
|
||||||
private Date startDate;
|
private Date startDate;
|
||||||
|
|
||||||
@Column(nullable = true)
|
@Column(nullable = false)
|
||||||
private Date endDate;
|
private Date endDate;
|
||||||
|
|
||||||
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false)
|
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user