From 60468bdc8f447938b335d0e23fbcdbddb50fbec6 Mon Sep 17 00:00:00 2001 From: jackdaw Date: Wed, 16 Nov 2016 17:15:13 +0900 Subject: [PATCH] . --- .../bridge/discoveryport/DiscoveryPort.java | 22 +++++++++---------- .../discoveryport/ServiceScanHistory.java | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java b/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java index a0033f4..3284eb7 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java +++ b/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java @@ -1,5 +1,6 @@ package com.loafle.bridge.discoveryport; +import com.loafle.bridge.discoveryhost.entity.DiscoveryHost; import com.loafle.bridge.discoveryport.type.PortType; import com.loafle.bridge.discoveryservice.entity.DiscoveryService; @@ -14,16 +15,16 @@ public class DiscoveryPort { @GeneratedValue(strategy = GenerationType.AUTO) private long id; -// @ManyToOne -// @JoinColumn(name = "HOST_ID", nullable = false) -// private DiscoveryHost host; -//public DiscoveryHost getHost() { -// return host; -//} -// -// public void setHost(DiscoveryHost host) { -// this.host = host; -// } + @ManyToOne + @JoinColumn(name = "HOST_ID", nullable = false) + private DiscoveryHost host; + public DiscoveryHost getHost() { + return host; + } + + public void setHost(DiscoveryHost host) { + this.host = host; + } @Column(nullable = false) @Enumerated(EnumType.STRING) private PortType portType; @@ -51,7 +52,6 @@ public class DiscoveryPort { @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false) private Date updateDate; - public DiscoveryPort() {} public DiscoveryPort(PortType type, short portNumber) { diff --git a/src/main/java/com/loafle/bridge/discoveryport/ServiceScanHistory.java b/src/main/java/com/loafle/bridge/discoveryport/ServiceScanHistory.java index 57b61a0..fc6554d 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/ServiceScanHistory.java +++ b/src/main/java/com/loafle/bridge/discoveryport/ServiceScanHistory.java @@ -16,7 +16,8 @@ public class ServiceScanHistory { @GeneratedValue(strategy = GenerationType.AUTO) private long id; - @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable = false, insertable = false, updatable = false) + @Column(nullable = false, insertable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) private Date createDate; @ManyToOne(fetch = FetchType.LAZY)