This is an automated email from the ASF dual-hosted git repository.
isjarana pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/develop by this push:
new d5da9402fb adding named query
new be7368309b Merge pull request #366 from isururanawaka/metaschedular
d5da9402fb is described below
commit d5da9402fb31aeecbb1f04724cd2bf653fdd41a5
Author: Isuru Ranawaka <[email protected]>
AuthorDate: Thu Dec 29 16:06:35 2022 -0500
adding named query
---
.../apache/airavata/registry/core/repositories/AbstractRepository.java | 2 +-
.../java/org/apache/airavata/registry/core/utils/QueryConstants.java | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git
a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
index 5f3b916cd0..fd88e6b296 100644
---
a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
+++
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/repositories/AbstractRepository.java
@@ -164,7 +164,7 @@ public abstract class AbstractRepository<T, E, Id> {
throw new RuntimeException("Failed to get EntityManager", e);
}
try {
- Query nativeQuery = entityManager.createNativeQuery(query);
+ Query nativeQuery = entityManager.createNamedQuery(query);
for(Map.Entry<String, Object> keyVal :queryParams.entrySet()) {
nativeQuery.setParameter(keyVal.getKey(),keyVal.getValue());
}
diff --git
a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
index c5e311925d..d4f07193c3 100644
---
a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
+++
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
@@ -194,6 +194,5 @@ public interface QueryConstants {
String GET_ALL_PROCESSES = "SELECT P FROM " +
ProcessEntity.class.getSimpleName() +" P ";
- String DELETE_JOB = " DELETE FROM "+JobEntity.class.getSimpleName()+ " " +
- "WHERE JOB_ID = :"+DBConstants.Job.JOB_ID+" AND TASK_ID =
:"+DBConstants.Job.TASK_ID;
+ String DELETE_JOB = " DELETE FROM "+JobEntity.class.getSimpleName()+ "
WHERE JOB_ID = :"+DBConstants.Job.JOB_ID+" AND TASK_ID =
:"+DBConstants.Job.TASK_ID;
}