diff --git a/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHost.java b/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHost.java index b5b024d..00dbcb0 100644 --- a/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHost.java +++ b/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHost.java @@ -67,6 +67,7 @@ public class DiscoveryHost { public DiscoveryHost(){} + public DiscoveryHost(long ip, long mac){ this.ip = ip; this.mac = mac; diff --git a/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHostController.java b/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHostController.java index b6c7e0d..170b8e0 100644 --- a/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHostController.java +++ b/src/main/java/com/loafle/bridge/discoveryhost/DiscoveryHostController.java @@ -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() { + + } } diff --git a/src/main/java/com/loafle/bridge/discoveryhost/PortScanHistory.java b/src/main/java/com/loafle/bridge/discoveryhost/PortScanHistory.java index bad096c..10a79c4 100644 --- a/src/main/java/com/loafle/bridge/discoveryhost/PortScanHistory.java +++ b/src/main/java/com/loafle/bridge/discoveryhost/PortScanHistory.java @@ -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)