You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2022/10/02 10:07:20 UTC
[isis] 02/05: ISIS-3230 : fixes for queries
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch release-2.0.0-M8-RC4
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 6b883b50bd456b3df80d16fcb1ca3e86e832450a
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 2 08:48:19 2022 +0100
ISIS-3230 : fixes for queries
---
.../extensions/commandlog/jdo/dom/CommandLogEntry.java | 2 +-
.../executionlog/jdo/dom/ExecutionLogEntry.java | 8 ++++----
.../executionlog/jpa/dom/ExecutionLogEntry.java | 16 ++++++++--------
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/dom/CommandLogEntry.java b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/dom/CommandLogEntry.java
index 1fc4167ed6..441054c22b 100644
--- a/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/dom/CommandLogEntry.java
+++ b/extensions/core/commandlog/persistence-jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/dom/CommandLogEntry.java
@@ -129,7 +129,7 @@ import lombok.Setter;
name = Nq.FIND_MOST_RECENT,
value = "SELECT "
+ " FROM " + CommandLogEntry.FQCN + " "
- + " ORDER BY timestamp DESC, interactionId DESC, sequence DESC"
+ + " ORDER BY timestamp DESC, interactionId DESC"
+ " RANGE 0,100"),
@Query(
name = Nq.FIND_RECENT_BY_USERNAME,
diff --git a/extensions/core/executionlog/persistence-jdo/src/main/java/org/apache/isis/extensions/executionlog/jdo/dom/ExecutionLogEntry.java b/extensions/core/executionlog/persistence-jdo/src/main/java/org/apache/isis/extensions/executionlog/jdo/dom/ExecutionLogEntry.java
index ea61bc16b5..13481a5096 100644
--- a/extensions/core/executionlog/persistence-jdo/src/main/java/org/apache/isis/extensions/executionlog/jdo/dom/ExecutionLogEntry.java
+++ b/extensions/core/executionlog/persistence-jdo/src/main/java/org/apache/isis/extensions/executionlog/jdo/dom/ExecutionLogEntry.java
@@ -99,20 +99,20 @@ import lombok.Setter;
name = Nq.FIND_BY_TIMESTAMP_BETWEEN,
value = "SELECT "
+ " FROM " + ExecutionLogEntry.FQCN + " "
- + " WHERE timestamp >= :timestampFrom "
- + " && timestamp <= :timestampTo "
+ + " WHERE timestamp >= :from "
+ + " && timestamp <= :to "
+ " ORDER BY timestamp DESC, interactionId DESC, sequence DESC"),
@Query(
name = Nq.FIND_BY_TIMESTAMP_AFTER,
value = "SELECT "
+ " FROM " + ExecutionLogEntry.FQCN + " "
- + " WHERE timestamp >= :timestamp "
+ + " WHERE timestamp >= :from "
+ " ORDER BY timestamp DESC, interactionId DESC, sequence DESC"),
@Query(
name = Nq.FIND_BY_TIMESTAMP_BEFORE,
value = "SELECT "
+ " FROM " + ExecutionLogEntry.FQCN + " "
- + " WHERE timestamp <= :timestamp "
+ + " WHERE timestamp <= :to "
+ " ORDER BY timestamp DESC, interactionId DESC, sequence DESC"),
@Query(
name = Nq.FIND,
diff --git a/extensions/core/executionlog/persistence-jpa/src/main/java/org/apache/isis/extensions/executionlog/jpa/dom/ExecutionLogEntry.java b/extensions/core/executionlog/persistence-jpa/src/main/java/org/apache/isis/extensions/executionlog/jpa/dom/ExecutionLogEntry.java
index f8a976882a..85c6d50092 100644
--- a/extensions/core/executionlog/persistence-jpa/src/main/java/org/apache/isis/extensions/executionlog/jpa/dom/ExecutionLogEntry.java
+++ b/extensions/core/executionlog/persistence-jpa/src/main/java/org/apache/isis/extensions/executionlog/jpa/dom/ExecutionLogEntry.java
@@ -108,26 +108,26 @@ import lombok.Setter;
name = Nq.FIND_BY_TIMESTAMP_BETWEEN,
query = "SELECT ele "
+ " FROM ExecutionLogEntry ele "
- + " WHERE ele.timestamp >= :timestampFrom "
- + " AND ele.timestamp <= :timestampTo "
+ + " WHERE ele.timestamp >= :from "
+ + " AND ele.timestamp <= :to "
+ " ORDER BY ele.timestamp DESC, ele.pk.interactionId DESC, ele.pk.sequence DESC"),
@NamedQuery(
name = Nq.FIND_BY_TIMESTAMP_AFTER,
query = "SELECT ele "
+ " FROM ExecutionLogEntry ele "
- + " WHERE ele.timestamp >= :timestamp "
+ + " WHERE ele.timestamp >= :from "
+ " ORDER BY ele.timestamp DESC, ele.pk.interactionId DESC, ele.pk.sequence DESC"),
@NamedQuery(
- name = Nq.FIND,
+ name = Nq.FIND_BY_TIMESTAMP_BEFORE,
query = "SELECT ele "
+ " FROM ExecutionLogEntry ele "
- + " ORDER BY ele.timestamp DESC"),
+ + " WHERE ele.timestamp <= :to "
+ + " ORDER BY ele.timestamp DESC, ele.pk.interactionId, ele.pk.sequence DESC"),
@NamedQuery(
- name = Nq.FIND_BY_TIMESTAMP_BEFORE,
+ name = Nq.FIND,
query = "SELECT ele "
+ " FROM ExecutionLogEntry ele "
- + " WHERE ele.timestamp <= :timestamp "
- + " ORDER BY ele.timestamp DESC, ele.pk.interactionId, ele.pk.sequence DESC"),
+ + " ORDER BY ele.timestamp DESC"),
@NamedQuery(
name = Nq.FIND_MOST_RECENT,
query = "SELECT ele "