From e8d27a8af3c0883e3dc48b4ad896c03143f10c8a Mon Sep 17 00:00:00 2001 From: jackdaw Date: Thu, 17 Nov 2016 11:33:35 +0900 Subject: [PATCH] . --- .../loafle/bridge/discoveryhistory/DiscoveryHistory.java | 2 +- .../java/com/loafle/bridge/discoveryport/DiscoveryPort.java | 6 +++--- src/main/resources/database.properties | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/loafle/bridge/discoveryhistory/DiscoveryHistory.java b/src/main/java/com/loafle/bridge/discoveryhistory/DiscoveryHistory.java index fc9df77..a7378bc 100644 --- a/src/main/java/com/loafle/bridge/discoveryhistory/DiscoveryHistory.java +++ b/src/main/java/com/loafle/bridge/discoveryhistory/DiscoveryHistory.java @@ -24,8 +24,8 @@ public class DiscoveryHistory @Column(nullable=false) private Boolean result; - @Column(nullable=false) @JoinColumn + @OneToOne private DiscoveryZone zone; public DiscoveryZone getZone() { diff --git a/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java b/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java index 28e7f7d..6b5b0f0 100644 --- a/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java +++ b/src/main/java/com/loafle/bridge/discoveryport/DiscoveryPort.java @@ -16,7 +16,7 @@ public class DiscoveryPort { private long id; @ManyToOne - @JoinColumn(name = "HOST_ID", nullable = false) + @JoinColumn private DiscoveryHost host; public DiscoveryHost getHost() { return host; @@ -54,12 +54,12 @@ public class DiscoveryPort { public DiscoveryPort() {} - public DiscoveryPort(PortType type, short portNumber) { + public DiscoveryPort(PortType type, int portNumber) { this.portType = type; this.portNumber = portNumber; } - public DiscoveryPort(DiscoveryHost host, PortType type, short portNumber) { + public DiscoveryPort(DiscoveryHost host, PortType type, int portNumber) { this.host = host; this.portType = type; this.portNumber = portNumber; diff --git a/src/main/resources/database.properties b/src/main/resources/database.properties index d9f650f..07b3361 100644 --- a/src/main/resources/database.properties +++ b/src/main/resources/database.properties @@ -10,7 +10,7 @@ spring.datasource.driver-class-name=org.h2.Driver ## Hibernate configuration spring.jpa.database=h2 -#spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=create-drop +#spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.show-sql=true \ No newline at end of file