Skip to content

armgit / core

Public Imported from GitHub
0

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

Made Datapoints use Timestamp without timezone information(UTC)

Michael Rademaker7e98e6481514
diff --git a/manager/src/main/java/org/openremote/manager/rules/facade/PredictedFacade.java b/manager/src/main/java/org/openremote/manager/rules/facade/PredictedFacade.java
index 5b613854d..89c756004 100644
--- a/manager/src/main/java/org/openremote/manager/rules/facade/PredictedFacade.java
+++ b/manager/src/main/java/org/openremote/manager/rules/facade/PredictedFacade.java
@@ -43,8 +43,8 @@ public class PredictedFacade<T extends Ruleset> extends PredictedDatapoints {
}
@Override
- public ValueDatapoint[] getValueDataPoints(AttributeRef attributeRef, long fromTimestamp, long toTimestamp) {
- return assetPredictedDatapointService.getValueDatapoints(attributeRef, DatapointInterval.NONE, fromTimestamp, toTimestamp);
+ public ValueDatapoint[] getValueDataPoints(AttributeRef attributeRef, DatapointInterval interval, long fromTimestamp, long toTimestamp) {
+ return assetPredictedDatapointService.getValueDatapoints(attributeRef, interval, fromTimestamp, toTimestamp);
}
@Override
diff --git a/manager/src/main/resources/org/openremote/manager/setup/database/V20191202_01__Schema.sql b/manager/src/main/resources/org/openremote/manager/setup/database/V20191202_01__Schema.sql
index adcf8b877..ef8d6f01c 100644
--- a/manager/src/main/resources/org/openremote/manager/setup/database/V20191202_01__Schema.sql
+++ b/manager/src/main/resources/org/openremote/manager/setup/database/V20191202_01__Schema.sql
@@ -30,7 +30,7 @@ create table ASSET (
);
create table ASSET_DATAPOINT (
- TIMESTAMP timestamp with time zone not null,
+ TIMESTAMP timestamp not null,
ENTITY_ID varchar(36) not null,
ATTRIBUTE_NAME varchar(255) not null,
VALUE jsonb not null,
@@ -122,7 +122,7 @@ create table SYSLOG_EVENT (
);
create table ASSET_PREDICTED_DATAPOINT (
- TIMESTAMP timestamp with time zone not null,
+ TIMESTAMP timestamp not null,
ENTITY_ID varchar(36) not null,
ATTRIBUTE_NAME varchar(255) not null,
VALUE jsonb not null,
diff --git a/model/src/main/java/org/openremote/model/datapoint/Datapoint.java b/model/src/main/java/org/openremote/model/datapoint/Datapoint.java
index ba9b46215..1224792ee 100644
--- a/model/src/main/java/org/openremote/model/datapoint/Datapoint.java
+++ b/model/src/main/java/org/openremote/model/datapoint/Datapoint.java
@@ -49,7 +49,7 @@ public abstract class Datapoint implements Serializable {
protected String attributeName;
@Id
- @Column(name = "TIMESTAMP", updatable = false, nullable = false, columnDefinition = "TIMESTAMP WITH TIME ZONE")
+ @Column(name = "TIMESTAMP", updatable = false, nullable = false, columnDefinition = "TIMESTAMP")
protected Date timestamp;
@Column(name = "VALUE", columnDefinition = "jsonb", nullable = false)
diff --git a/model/src/main/java/org/openremote/model/rules/PredictedDatapoints.java b/model/src/main/java/org/openremote/model/rules/PredictedDatapoints.java
index f5357f1fb..133cadcab 100644
--- a/model/src/main/java/org/openremote/model/rules/PredictedDatapoints.java
+++ b/model/src/main/java/org/openremote/model/rules/PredictedDatapoints.java
@@ -20,6 +20,7 @@
package org.openremote.model.rules;
import org.openremote.model.attribute.AttributeRef;
+import org.openremote.model.datapoint.DatapointInterval;
import org.openremote.model.datapoint.ValueDatapoint;
import org.openremote.model.value.Value;
@@ -27,6 +28,7 @@ public abstract class PredictedDatapoints {
public abstract ValueDatapoint[] getValueDataPoints(AttributeRef attributeRef,
+ DatapointInterval interval,
long fromTimestamp,
long toTimestamp);