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