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

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

本文整理了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

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

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

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

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

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

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

private Notification.PathTokens getPathTokens(List<ServiceParameter> parameters){
  Notification.PathTokens pathTokens = new Notification.PathTokens();
  pathTokens.setApplicationRef((SimpleEntityRef)em.getApplicationRef());
  // first parameter is always collection name, start parsing after that
  for (int i = 0; i < parameters.size() - 1; i += 2 ) {
    String collection = pluralize(parameters.get(i).getName());
    Identifier identifier = null;
    String ql = null;
    ServiceParameter sp = parameters.get(i + 1);
    // if the next param is a query, add a token with the query
    if(sp.isQuery()){
      ql = sp.getQuery().getQl().get();
      pathTokens.getPathTokens().add(new Notification.PathToken( collection, ql));
    }else{
      // if the next param is "notifications", it's the end let identifier be null
      if(sp.isName() && !sp.getName().equalsIgnoreCase("notifications") || sp.isId()){
        identifier = sp.getIdentifier();
      }
      pathTokens.getPathTokens().add(new Notification.PathToken( collection, identifier));
    }
  }
  return pathTokens;
}

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

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

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

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

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

protected Iterator refIterator(EntityManager em, boolean useGraph) throws Exception {
  if ( query.getQl() == null && query.getSingleNameOrEmailIdentifier() != null){
    return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
  }
  if ( type != null  && uuid != null) {
    return new PagingResultsIterator( getHeadResults( em ), Level.REFS, null);
  }
  else {
    Query q = query;
    if ( query.getResultsLevel() != Level.REFS ) { // ensure REFS level
      q = new Query( q );
      q.setResultsLevel( Level.REFS );
    }
    if( useGraph){
      return new NotificationGraphIterator( em, source.refIterator( em, true), q );
    }else{
      return new MultiQueryIterator( em, source.refIterator( em, false ), q );
    }
  }
}

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

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

相关文章