org.apache.usergrid.persistence.Query.getQl()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(312)

本文整理了Java中org.apache.usergrid.persistence.Query.getQl方法的一些代码示例,展示了Query.getQl的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getQl方法的具体详情如下:
包路径:org.apache.usergrid.persistence.Query
类名称:Query
方法名:getQl

Query.getQl介绍

暂无

代码示例

代码示例来源:origin: apache/usergrid

  1. if ( !query.getQl().isPresent() && query.getSingleUuidIdentifier() != null) {
  2. } else if ( !query.getQl().isPresent() && query.getSingleNameOrEmailIdentifier() != null){
  3. logger.trace("getHeadResults(): sending query to ES: appid={}, collection={}, query=[{}]",
  4. uuid.toString(), query.getCollection(),
  5. query.getQl().isPresent() ? query.getQl().get() : "NONE");

代码示例来源:origin: apache/usergrid

  1. @Test
  2. public void testQueryParamsWithUrlEncodedPlus(){
  3. String qlString = "select * where email='test+value@usergrid.com'";
  4. Map<String,List<String>> queryParams = new HashMap<>();
  5. queryParams.put("ql", Collections.singletonList(qlString.replace("+", "%2b")));
  6. Query query = Query.fromQueryParams(queryParams);
  7. assertEquals(qlString, query.getQl().get());
  8. }

代码示例来源:origin: apache/usergrid

  1. @Test
  2. public void testQueryParamsWithPlus(){
  3. String qlString = "select * where email='test+value@usergrid.com'";
  4. Map<String,List<String>> queryParams = new HashMap<>();
  5. queryParams.put("ql", Collections.singletonList(qlString) );
  6. Query query = Query.fromQueryParams(queryParams);
  7. assertEquals(qlString, query.getQl().get());
  8. }

代码示例来源:origin: apache/usergrid

  1. private Notification.PathTokens getPathTokens(List<ServiceParameter> parameters){
  2. Notification.PathTokens pathTokens = new Notification.PathTokens();
  3. pathTokens.setApplicationRef((SimpleEntityRef)em.getApplicationRef());
  4. // first parameter is always collection name, start parsing after that
  5. for (int i = 0; i < parameters.size() - 1; i += 2 ) {
  6. String collection = pluralize(parameters.get(i).getName());
  7. Identifier identifier = null;
  8. String ql = null;
  9. ServiceParameter sp = parameters.get(i + 1);
  10. // if the next param is a query, add a token with the query
  11. if(sp.isQuery()){
  12. ql = sp.getQuery().getQl().get();
  13. pathTokens.getPathTokens().add(new Notification.PathToken( collection, ql));
  14. }else{
  15. // if the next param is "notifications", it's the end let identifier be null
  16. if(sp.isName() && !sp.getName().equalsIgnoreCase("notifications") || sp.isId()){
  17. identifier = sp.getIdentifier();
  18. }
  19. pathTokens.getPathTokens().add(new Notification.PathToken( collection, identifier));
  20. }
  21. }
  22. return pathTokens;
  23. }

代码示例来源:origin: apache/usergrid

  1. final Optional<String> queryString = query.isGraphSearch()? Optional.<String>absent(): query.getQl();
  2. final boolean isConnecting = query.isConnecting();

代码示例来源:origin: apache/usergrid

  1. private Query adjustQuery( Query query ) {
  2. if ( query.getQl().isPresent() ) {
  3. return query;

代码示例来源:origin: apache/usergrid

  1. protected Iterator refIterator(EntityManager em, boolean useGraph) throws Exception {
  2. if ( query.getQl() == null && query.getSingleNameOrEmailIdentifier() != null){
  3. return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
  4. }
  5. if ( type != null && uuid != null) {
  6. return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
  7. }
  8. else {
  9. Query q = query;
  10. if ( query.getResultsLevel() != Level.REFS ) { // ensure REFS level
  11. q = new Query( q );
  12. q.setResultsLevel( Level.REFS );
  13. }
  14. if( useGraph){
  15. return new NotificationGraphIterator( em, source.refIterator( em, true), q );
  16. }else{
  17. return new MultiQueryIterator( em, source.refIterator( em, false ), q );
  18. }
  19. }
  20. }

代码示例来源:origin: apache/usergrid

  1. final Optional<String> queryString = query.isGraphSearch()? Optional.<String>absent(): query.getQl();
  2. final Id ownerId = headEntity.asId();
  3. final boolean analyzeOnly = query.getAnalyzeOnly();

相关文章