host jpa option edited

This commit is contained in:
geek 2016-11-18 11:31:25 +09:00
parent 14cdf606cd
commit 8bafd55e71
3 changed files with 20 additions and 3 deletions

View File

@ -67,6 +67,7 @@ public class DiscoveryHost {
public DiscoveryHost(){}
public DiscoveryHost(long ip, long mac){
this.ip = ip;
this.mac = mac;

View File

@ -1,7 +1,23 @@
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.
*/
@RestController
public class DiscoveryHostController {
@Autowired
private DiscoveryHostRepository repository;
@RequestMapping(value ="/hostTest")
@Transactional
public void testHost() {
}
}

View File

@ -18,7 +18,7 @@ public class PortScanHistory {
private long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
@JoinColumn(name = "HOST_ID", nullable = false)
@JsonIgnore
private DiscoveryHost host;
@ -44,10 +44,10 @@ public class PortScanHistory {
@Column(nullable = true)
private String description;
@Column(nullable = true)
@Column(nullable = false)
private Date startDate;
@Column(nullable = true)
@Column(nullable = false)
private Date endDate;
@Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false)