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(){}
public DiscoveryHost(long ip, long mac){ public DiscoveryHost(long ip, long mac){
this.ip = ip; this.ip = ip;
this.mac = mac; this.mac = mac;

View File

@ -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() {
}
} }

View File

@ -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)