1 19 20 package org.apache.cayenne.remote; 21 22 import org.apache.cayenne.map.DataMap; 23 import org.apache.cayenne.map.DbEntity; 24 import org.apache.cayenne.map.EntityResolver; 25 import org.apache.cayenne.map.ObjEntity; 26 import org.apache.cayenne.map.Procedure; 27 import org.apache.cayenne.query.PrefetchTreeNode; 28 import org.apache.cayenne.query.Query; 29 import org.apache.cayenne.query.QueryMetadata; 30 import org.apache.cayenne.query.QueryRouter; 31 import org.apache.cayenne.query.SQLAction; 32 import org.apache.cayenne.query.SQLActionVisitor; 33 import org.apache.cayenne.query.SQLResultSetMapping; 34 import org.apache.cayenne.reflect.ClassDescriptor; 35 36 43 class RangeQuery implements Query { 44 45 private String cacheKey; 46 private int fetchStartIndex; 47 private int fetchLimit; 48 private boolean fetchingDataRows; 49 private PrefetchTreeNode prefetchTree; 50 51 private RangeQuery() { 53 54 } 55 56 60 public RangeQuery(String cacheKey, int fetchStartIndex, int fetchLimit, 61 QueryMetadata rootMetadata) { 62 this.cacheKey = cacheKey; 63 this.fetchStartIndex = fetchStartIndex; 64 this.fetchLimit = fetchLimit; 65 this.fetchingDataRows = rootMetadata.isFetchingDataRows(); 66 this.prefetchTree = rootMetadata.getPrefetchTree(); 67 } 68 69 public QueryMetadata getMetaData(EntityResolver resolver) { 70 return new QueryMetadata() { 71 72 public SQLResultSetMapping getResultSetMapping() { 73 return null; 74 } 75 76 public String getCacheKey() { 77 return cacheKey; 78 } 79 80 public String [] getCacheGroups() { 81 return null; 82 } 83 84 public int getFetchStartIndex() { 85 return fetchStartIndex; 86 } 87 88 public int getFetchLimit() { 89 return fetchLimit; 90 } 91 92 public boolean isFetchingDataRows() { 93 return fetchingDataRows; 94 } 95 96 public int getPageSize() { 97 return 0; 98 } 99 100 public String getCachePolicy() { 101 return QueryMetadata.NO_CACHE; 102 } 103 104 public PrefetchTreeNode getPrefetchTree() { 105 return prefetchTree; 106 } 107 108 public DataMap getDataMap() { 109 throw new UnsupportedOperationException (); 110 } 111 112 public DbEntity getDbEntity() { 113 throw new UnsupportedOperationException (); 114 } 115 116 public ObjEntity getObjEntity() { 117 throw new UnsupportedOperationException (); 118 } 119 120 public ClassDescriptor getClassDescriptor() { 121 throw new UnsupportedOperationException (); 122 } 123 124 public Procedure getProcedure() { 125 throw new UnsupportedOperationException (); 126 } 127 128 public boolean isRefreshingObjects() { 129 throw new UnsupportedOperationException (); 130 } 131 132 public boolean isResolvingInherited() { 133 throw new UnsupportedOperationException (); 134 } 135 }; 136 } 137 138 public SQLAction createSQLAction(SQLActionVisitor visitor) { 139 throw new UnsupportedOperationException (); 140 } 141 142 public String getName() { 143 throw new UnsupportedOperationException (); 144 } 145 146 public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery) { 147 throw new UnsupportedOperationException (); 148 } 149 } 150 | Popular Tags |