Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Upgrade hibernate to latest release (#1845)

Rich Turner069f2ecb06be
diff --git a/gradle.properties b/gradle.properties
index 85a391d88..b2178463d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -22,7 +22,7 @@ jacksonVersion = 2.18.3
groovyVersion = 4.0.24
groovySandboxVersion = 4.2.2
sqliteVersion = 3.49.1.0
-hibernateVersion = 6.5.3.Final
+hibernateVersion = 6.6.11.Final
hibernateValidatorVersion = 8.0.2.Final
hikaricpVersion = 6.2.1
postgresJdbcVersion = 42.7.5
diff --git a/model/src/main/java/org/openremote/model/attribute/AttributeMap.java b/model/src/main/java/org/openremote/model/attribute/AttributeMap.java
index 5d2dcee49..c979fde31 100644
--- a/model/src/main/java/org/openremote/model/attribute/AttributeMap.java
+++ b/model/src/main/java/org/openremote/model/attribute/AttributeMap.java
@@ -22,6 +22,7 @@ package org.openremote.model.attribute;
import org.openremote.model.value.AttributeDescriptor;
import org.openremote.model.value.ValueDescriptor;
+import javax.annotation.CheckForNull;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
@@ -69,4 +70,14 @@ public class AttributeMap extends NamedMap<Attribute<?>> {
public <T> void setValue(AttributeDescriptor<T> descriptor, T value) {
getOrCreate(descriptor).setValue(value);
}
+
+ @Override
+ public boolean equals(@CheckForNull Object object) {
+ return super.equals(object);
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
}
diff --git a/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierGenerator.java b/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierGenerator.java
index 37011e535..ac6040743 100644
--- a/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierGenerator.java
+++ b/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierGenerator.java
@@ -38,4 +38,9 @@ public class HibernateUniqueIdentifierGenerator implements IdentifierGenerator {
}
return UniqueIdentifierGenerator.generateId();
}
+
+ @Override
+ public boolean allowAssignedIdentifiers() {
+ return true;
+ }
}
diff --git a/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierType.java b/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierType.java
index 768113d34..1e0193e08 100644
--- a/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierType.java
+++ b/model/src/main/java/org/openremote/model/util/HibernateUniqueIdentifierType.java
@@ -12,4 +12,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@IdGeneratorType(HibernateUniqueIdentifierGenerator.class)
@Retention(RUNTIME) @Target({METHOD,FIELD})
public @interface HibernateUniqueIdentifierType {
+
+
}
diff --git a/test/src/test/groovy/org/openremote/test/console/ConsoleTest.groovy b/test/src/test/groovy/org/openremote/test/console/ConsoleTest.groovy
index 1b1488298..e5af4eb05 100644
--- a/test/src/test/groovy/org/openremote/test/console/ConsoleTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/console/ConsoleTest.groovy
@@ -677,8 +677,12 @@ class ConsoleTest extends Specification implements ManagerContainerTrait {
notificationIds.clear()
messages.clear()
- and: "an existing ruleset containing a radial location predicate is updated"
- newRuleset.rules = getClass().getResource("/org/openremote/test/rules/BasicLocationPredicates.groovy").text
+ and: "a new ruleset is created containing a radial location predicate"
+ newRuleset = new AssetRuleset(
+ testUser3Console1.parentId,
+ "Console test location predicates",
+ Ruleset.Lang.GROOVY,
+ getClass().getResource("/org/openremote/test/rules/BasicLocationPredicates.groovy").text)
newRuleset = rulesetStorageService.merge(newRuleset)
then: "a push notification should have been sent to all consoles telling them to refresh their geofences"