You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/08/04 15:38:15 UTC

git commit: [OLINGO-376] Fetch 0 records when $top is 0.

Repository: olingo-odata2
Updated Branches:
  refs/heads/master 44604c78f -> 3b3987bc2


[OLINGO-376] Fetch 0 records when $top is 0.


Signed-off-by: Chandan V A <ch...@sap.com>

Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/3b3987bc
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/3b3987bc
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/3b3987bc

Branch: refs/heads/master
Commit: 3b3987bc216d14c78055baa6a460948eb198b041
Parents: 44604c7
Author: Chandan V A <ch...@sap.com>
Authored: Mon Aug 4 19:08:08 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Mon Aug 4 19:08:08 2014 +0530

----------------------------------------------------------------------
 .../jpa/processor/core/access/data/JPAProcessorImpl.java       | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/3b3987bc/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
index fdef108..e7f041b 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
 
+import org.apache.olingo.odata2.api.commons.InlineCount;
 import org.apache.olingo.odata2.api.edm.EdmEntitySet;
 import org.apache.olingo.odata2.api.edm.EdmEntityType;
 import org.apache.olingo.odata2.api.edm.EdmException;
@@ -129,6 +130,11 @@ public class JPAProcessorImpl implements JPAProcessor {
     if (uriParserResultView.getFunctionImport() != null) {
       return (List<Object>) process((GetFunctionImportUriInfo) uriParserResultView);
     }
+    InlineCount inlineCount = uriParserResultView.getInlineCount();
+    Integer top = uriParserResultView.getTop();
+    if (top != null && top.intValue() == 0 && inlineCount != null && inlineCount.equals(InlineCount.ALLPAGES)) {
+      return new ArrayList<Object>();
+    }
     JPQLContextType contextType = null;
     try {
       if (!uriParserResultView.getStartEntitySet().getName()