@Test @SuppressWarnings("unchecked") public void fullQuery() throws JsonGenerationException, JsonMappingException, IOException { CMSQuery query = new CMSQuery(RAPTOR_PAAS, IBranch.DEFAULT_BRANCH, "ApplicationService[@name=~\":Raptor\"]{*}?allowFullTableScan=false"); query.setAllowFullTableScan(true); CMSClientContext context = new CMSClientContext(); List<ApplicationService> queryResults = raptorService.query(query, ApplicationService.class, context) .getEntities(); Assert.assertNotNull(queryResults); Assert.assertTrue(queryResults.size() > 0); Assert.assertTrue(queryResults.get(0).get_metaclass().equals("ApplicationService")); long count = 0; Map<String, Integer> servicesMap = new HashMap<String, Integer>(); for (ICMSEntity ent : queryResults) { List<ServiceInstance> services = (List<ServiceInstance>)ent.getFieldValue("services"); if (services != null) { servicesMap.put(ent.get_id(), services.size()); ++count; } } query.setQueryString("ApplicationService[@name=~\":Raptor\"]{*}.services{*}"); query.setLimits(new long[] {1, 2}); context.setComment(""); context.setUser(""); CMSQueryResult<ApplicationService> result = raptorService.fullQuery(query, ApplicationService.class, context); List<ApplicationService> queryResults2 = result.getEntities(); Assert.assertNotNull(queryResults2); Assert.assertEquals(count, queryResults2.size()); Assert.assertEquals(count, result.getCount().longValue()); Assert.assertTrue(result.getDbTimeCost() > 0); Assert.assertTrue(result.getTotalTimeCost() > 0); Assert.assertFalse(result.isHasMore()); Assert.assertTrue(queryResults2.get(0).get_metaclass().equals("ApplicationService")); for (ICMSEntity ent : queryResults2) { List<ServiceInstance> services = (List<ServiceInstance>)ent.getFieldValue("services"); Assert.assertTrue(servicesMap.containsKey(ent.get_id())); Assert.assertEquals(services.size(), servicesMap.get(ent.get_id()).intValue()); } }
public <T extends ICMSEntity> CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context) { return queryService.fullQuery(query, targetClass, context); }
CMSClientService { public <T extends ICMSEntity> CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context) { return queryService.fullQuery(query, targetClass, context); } }
CMSClientService { public <T extends ICMSEntity> CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context) { return queryService.fullQuery(query, targetClass, context); } private  CMSClientService(CMSClientConfig config); }
CMSClientService { public <T extends ICMSEntity> CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context) { return queryService.fullQuery(query, targetClass, context); } private  CMSClientService(CMSClientConfig config); static CMSClientService getClientService(CMSClientConfig config); static CMSClientService getClientService(CMSClientConfig config, String user, String password); CMSClientConfig getClientConfig(); String getToken(String user, String password); @Deprecated T get(String id, Class<T> entityClass); T get(String id, Class<T> entityClass, CMSClientContext context, String... includeFieldNames); List<T> getEntitiesByField(Class<T> entityClass, String queryPath, String fieldName,
            Object fieldValue, CMSClientContext context, String... includeFieldNames); T getEntityByField(Class<T> entityClass, String queryPath, String fieldName,
            Object fieldValue, CMSClientContext context, String... includeFieldNames); @Deprecated List<T> get(Class<T> entityClass, int limit); List<T> get(Class<T> entityClass, int limit, CMSClientContext context, String... includeFieldNames); @Deprecated T create(T entity); T create(T entity, CMSClientContext context); @Deprecated CMSQueryResult<T> query(CMSQuery query, Class<T> targetClass); QueryIterator<T> queryIterator(CMSQuery query, Class<T> clz, CMSClientContext context); CMSQueryResult<T> query(CMSQuery query, Class<T> targetClass, CMSClientContext context); @Deprecated void delete(T entity); void delete(T entity, CMSClientContext context); @Deprecated void update(T entity); void update(T entity, CMSClientContext context); void updateWithRetry(T entity, CMSClientContext context); void updateEntityField(T entity, String fieldName, CMSClientContext context); void updateEntityField(T entity, String fieldName, T oldValueEntity,
            CMSClientContext context); @Deprecated void replace(T entity); void replace(T entity, CMSClientContext context); @Deprecated List<String> batchCreate(List<T> entities); List<String> batchCreate(List<T> entities, CMSClientContext context); @Deprecated void batchUpdate(List<T> entities); void batchUpdate(List<T> entities, CMSClientContext context); @Deprecated void batchDelete(List<T> entities); void batchDelete(List<T> entities, CMSClientContext context); @Deprecated GenericCMSEntity get(String id, String metadata); GenericCMSEntity get(String id, String metadata, CMSClientContext context, String... includeFieldNames); @Deprecated List<GenericCMSEntity> get(GenericCMSEntity queryEntity, int limit); List<GenericCMSEntity> get(GenericCMSEntity queryEntity, int limit, CMSClientContext context, String... includeFieldNames); @Deprecated CMSQueryResult<GenericCMSEntity> query(CMSQuery query); CMSQueryResult<GenericCMSEntity> query(CMSQuery query, CMSClientContext context); CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context); QueryIterator<T> getDanglingReference(Class<T> clz, String attribute, CMSClientContext context); QueryIterator<GenericCMSEntity> getDanglingReference(String metadata, String attribute, String refDataType, CMSClientContext context); QueryIterator<T> getEmptyReference(Class<T> clz, String attribute, CMSClientContext context); QueryIterator<GenericCMSEntity> getEmptyReference(String metadata, String attribute, CMSClientContext context); List<GenericCMSEntity> getEntitiesByField(String queryPath, String fieldName, Object fieldValue,
            CMSClientContext context, String... includeFieldNames); GenericCMSEntity getEntityByField(String queryPath, String fieldName, Object fieldValue,
            CMSClientContext context, String... includeFieldNames); @Deprecated Set<String> getMetadataFields(String metadata); Map<String, MetaClass> getMetadatas(CMSClientContext context); MetaClass getMetadata(String metadata, CMSClientContext context); Set<String> getMetadataFields(String metadata, CMSClientContext context); @Deprecated void appendToArray(T t, String fieldName); void appendToArray(T t, String fieldName, CMSClientContext context); @Deprecated void appendToJson(T t, String fieldName); void appendToJson(T t, String fieldName, CMSClientContext context); @Deprecated void deleteField(T t, String fieldName); void deleteField(T t, String fieldName, CMSClientContext context); void createRelationship(T fromEntity, String refField, K toEntity, CMSClientContext context); @Deprecated void createRelationship(T fromEntity, RelationshipField<T, K> field, K toEntity, CMSClientContext context); void deleteRelationship(T fromEntity, String refField, K toEntity, CMSClientContext context); @Deprecated void deleteRelationship(T fromEntity, RelationshipField<T, K> field, K toEntity, CMSClientContext context); boolean isAlive(); static boolean isAlive(String url); synchronized void close(); }
CMSClientService { public <T extends ICMSEntity> CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context) { return queryService.fullQuery(query, targetClass, context); } private  CMSClientService(CMSClientConfig config); static CMSClientService getClientService(CMSClientConfig config); static CMSClientService getClientService(CMSClientConfig config, String user, String password); CMSClientConfig getClientConfig(); String getToken(String user, String password); @Deprecated T get(String id, Class<T> entityClass); T get(String id, Class<T> entityClass, CMSClientContext context, String... includeFieldNames); List<T> getEntitiesByField(Class<T> entityClass, String queryPath, String fieldName,
            Object fieldValue, CMSClientContext context, String... includeFieldNames); T getEntityByField(Class<T> entityClass, String queryPath, String fieldName,
            Object fieldValue, CMSClientContext context, String... includeFieldNames); @Deprecated List<T> get(Class<T> entityClass, int limit); List<T> get(Class<T> entityClass, int limit, CMSClientContext context, String... includeFieldNames); @Deprecated T create(T entity); T create(T entity, CMSClientContext context); @Deprecated CMSQueryResult<T> query(CMSQuery query, Class<T> targetClass); QueryIterator<T> queryIterator(CMSQuery query, Class<T> clz, CMSClientContext context); CMSQueryResult<T> query(CMSQuery query, Class<T> targetClass, CMSClientContext context); @Deprecated void delete(T entity); void delete(T entity, CMSClientContext context); @Deprecated void update(T entity); void update(T entity, CMSClientContext context); void updateWithRetry(T entity, CMSClientContext context); void updateEntityField(T entity, String fieldName, CMSClientContext context); void updateEntityField(T entity, String fieldName, T oldValueEntity,
            CMSClientContext context); @Deprecated void replace(T entity); void replace(T entity, CMSClientContext context); @Deprecated List<String> batchCreate(List<T> entities); List<String> batchCreate(List<T> entities, CMSClientContext context); @Deprecated void batchUpdate(List<T> entities); void batchUpdate(List<T> entities, CMSClientContext context); @Deprecated void batchDelete(List<T> entities); void batchDelete(List<T> entities, CMSClientContext context); @Deprecated GenericCMSEntity get(String id, String metadata); GenericCMSEntity get(String id, String metadata, CMSClientContext context, String... includeFieldNames); @Deprecated List<GenericCMSEntity> get(GenericCMSEntity queryEntity, int limit); List<GenericCMSEntity> get(GenericCMSEntity queryEntity, int limit, CMSClientContext context, String... includeFieldNames); @Deprecated CMSQueryResult<GenericCMSEntity> query(CMSQuery query); CMSQueryResult<GenericCMSEntity> query(CMSQuery query, CMSClientContext context); CMSQueryResult<T> fullQuery(CMSQuery query, Class<T> targetClass, CMSClientContext context); QueryIterator<T> getDanglingReference(Class<T> clz, String attribute, CMSClientContext context); QueryIterator<GenericCMSEntity> getDanglingReference(String metadata, String attribute, String refDataType, CMSClientContext context); QueryIterator<T> getEmptyReference(Class<T> clz, String attribute, CMSClientContext context); QueryIterator<GenericCMSEntity> getEmptyReference(String metadata, String attribute, CMSClientContext context); List<GenericCMSEntity> getEntitiesByField(String queryPath, String fieldName, Object fieldValue,
            CMSClientContext context, String... includeFieldNames); GenericCMSEntity getEntityByField(String queryPath, String fieldName, Object fieldValue,
            CMSClientContext context, String... includeFieldNames); @Deprecated Set<String> getMetadataFields(String metadata); Map<String, MetaClass> getMetadatas(CMSClientContext context); MetaClass getMetadata(String metadata, CMSClientContext context); Set<String> getMetadataFields(String metadata, CMSClientContext context); @Deprecated void appendToArray(T t, String fieldName); void appendToArray(T t, String fieldName, CMSClientContext context); @Deprecated void appendToJson(T t, String fieldName); void appendToJson(T t, String fieldName, CMSClientContext context); @Deprecated void deleteField(T t, String fieldName); void deleteField(T t, String fieldName, CMSClientContext context); void createRelationship(T fromEntity, String refField, K toEntity, CMSClientContext context); @Deprecated void createRelationship(T fromEntity, RelationshipField<T, K> field, K toEntity, CMSClientContext context); void deleteRelationship(T fromEntity, String refField, K toEntity, CMSClientContext context); @Deprecated void deleteRelationship(T fromEntity, RelationshipField<T, K> field, K toEntity, CMSClientContext context); boolean isAlive(); static boolean isAlive(String url); synchronized void close();  }