deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject deltaspike git commit: DELTASPIKE-978 Map native queries to Entities
Date Mon, 05 Oct 2015 08:34:39 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 1572c07eb -> 0eb8df7f1


DELTASPIKE-978 Map native queries to Entities


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/0eb8df7f
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/0eb8df7f
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/0eb8df7f

Branch: refs/heads/master
Commit: 0eb8df7f144d3e2d5e649a71810cbbd2b97ec019
Parents: 1572c07
Author: Thomas Hug <Thomas.Hug@ctp.com>
Authored: Tue Aug 11 10:03:39 2015 +0200
Committer: Thomas Hug <Thomas.Hug@ctp.com>
Committed: Fri Oct 2 18:21:34 2015 +0200

----------------------------------------------------------------------
 .../apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java | 2 +-
 .../org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/0eb8df7f/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
index 91c4035..a4393df 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
@@ -70,7 +70,7 @@ public class AnnotatedQueryBuilder extends QueryBuilder
         else if (query.isNative())
         {
             String jpqlQuery = context.applyQueryStringPostProcessors(query.value());
-            result = params.applyTo(entityManager.createNativeQuery(jpqlQuery));
+            result = params.applyTo(entityManager.createNativeQuery(jpqlQuery, context.getEntityClass()));
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/0eb8df7f/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
index 6cffe98..d78138b 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/handler/QueryHandlerTest.java
@@ -255,6 +255,8 @@ public class QueryHandlerTest extends TransactionalTestCase
         // then
         assertNotNull(result);
         assertEquals(2, result.size());
+        assertTrue(result.get(0) instanceof Simple);
+        assertEquals(name, result.get(0).getName());
     }
 
     @Test


Mime
View raw message