deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1070 cosmetics
Date Wed, 07 Jun 2017 09:09:00 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 3451eb32f -> 80d672bf0


DELTASPIKE-1070 cosmetics

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

Branch: refs/heads/master
Commit: 80d672bf06b88fd2e1f501cf48fefe8d588acd7f
Parents: 3451eb3
Author: Thomas Andraschko <tandraschko@apache.org>
Authored: Wed Jun 7 11:08:47 2017 +0200
Committer: Thomas Andraschko <tandraschko@apache.org>
Committed: Wed Jun 7 11:08:47 2017 +0200

----------------------------------------------------------------------
 .../data/impl/builder/DelegateQueryBuilder.java         |  4 ++--
 .../data/impl/builder/result/QueryProcessorFactory.java |  2 +-
 .../data/impl/handler/CdiQueryInvocationContext.java    |  5 -----
 .../data/impl/meta/RepositoryMethodMetadata.java        | 12 +++++++++++-
 .../impl/meta/RepositoryMethodMetadataInitializer.java  |  3 +++
 5 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/80d672bf/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java
index e42ee19..9994f1d 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/DelegateQueryBuilder.java
@@ -63,11 +63,11 @@ public class DelegateQueryBuilder extends QueryBuilder
             if (delegate != null)
             {
                 Object result = invoke(delegate, context);
-                if (result instanceof Collection && StreamUtil.isStreamReturned(context.getMethod()))
+                if (result instanceof Collection && context.getRepositoryMethodMetadata().isStreamAsReturnType())
                 {
                     return StreamUtil.wrap(result);
                 }
-                else if (OptionalUtil.isOptionalReturned(context.getMethod()))
+                else if (context.getRepositoryMethodMetadata().isOptionalAsReturnType())
                 {
                     return OptionalUtil.wrap(result);
                 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/80d672bf/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
index 247a4a2..8812ae1 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
@@ -152,7 +152,7 @@ public final class QueryProcessorFactory
                     result = !queryResult.isEmpty() ? queryResult.get(0) : null;
             }
             
-            if (context.isOptionalAsReturnType())
+            if (context.getRepositoryMethodMetadata().isOptionalAsReturnType())
             {
                 return OptionalUtil.wrap(result);
             }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/80d672bf/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
index 09611f7..16d9aee 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/CdiQueryInvocationContext.java
@@ -383,11 +383,6 @@ public class CdiQueryInvocationContext implements QueryInvocationContext
         return false;
     }
 
-    public boolean isOptionalAsReturnType()
-    {
-        return this.repositoryMethodMetadata.isOptionalAsReturnType();
-    }
-
     public RepositoryMetadata getRepositoryMetadata()
     {
         return repositoryMetadata;

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/80d672bf/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadata.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadata.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadata.java
index bb4bdb2..c57d834 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadata.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadata.java
@@ -41,6 +41,7 @@ public class RepositoryMethodMetadata
     private boolean queryInOutMapperIsNormalScope;
     
     private boolean optionalAsReturnType;
+    private boolean streamAsReturnType;
 
     public RepositoryMethodMetadata()
     {
@@ -151,5 +152,14 @@ public class RepositoryMethodMetadata
     {
         this.modifying = modifying;
     } 
-    
+
+    public boolean isStreamAsReturnType()
+    {
+        return streamAsReturnType;
+    }
+
+    public void setStreamAsReturnType(boolean streamAsReturnType)
+    {
+        this.streamAsReturnType = streamAsReturnType;
+    }
 }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/80d672bf/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java
index 6552411..f0519d2 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/meta/RepositoryMethodMetadataInitializer.java
@@ -30,6 +30,7 @@ import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 
 import org.apache.deltaspike.core.util.OptionalUtil;
+import org.apache.deltaspike.core.util.StreamUtil;
 import org.apache.deltaspike.data.api.Modifying;
 import org.apache.deltaspike.data.api.Query;
 import org.apache.deltaspike.data.api.Repository;
@@ -68,6 +69,8 @@ public class RepositoryMethodMetadataInitializer
         
         repositoryMethodMetadata.setOptionalAsReturnType(
                 OptionalUtil.isOptionalReturned(method));
+        repositoryMethodMetadata.setStreamAsReturnType(
+                StreamUtil.isStreamReturned(method));
 
         initQueryRoot(repositoryMetadata, repositoryMethodMetadata);
         initQueryInOutMapperIsNormalScope(repositoryMetadata, repositoryMethodMetadata, beanManager);


Mime
View raw message