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

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

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

Query.fromQLNullSafe介绍

[英]Create a query instance from the QL. If the string is null, return an empty query
[中]从QL创建一个查询实例。如果字符串为null,则返回一个空查询

代码示例

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

@Override
public Results getImports(final UUID applicationId, @Nullable final String ql, @Nullable final String cursor) {
  Preconditions.checkNotNull(applicationId, "applicationId must be specified");
  try {
    final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
    final Entity appInfo = getApplicationInfoEntity(rootEm, applicationId);
    Query query = Query.fromQLNullSafe(ql);
    query.setCursor(cursor);
    //set our entity type
    query.setEntityType(Schema.getDefaultSchema().getEntityType(Import.class));
    return rootEm.searchCollection(appInfo, APP_IMPORT_CONNECTION, query);
  } catch (Exception e) {
    throw new RuntimeException("Unable to get import entity", e);
  }
}

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

@Override
public Results getFailedImportEntities(final UUID applicationId, final UUID importId, final UUID fileImportId,
                    @Nullable final String ql, @Nullable final String cursor) {
  Preconditions.checkNotNull(applicationId, "applicationId must be specified");
  Preconditions.checkNotNull(importId, "importId must be specified");
  Preconditions.checkNotNull(fileImportId, "fileImportId must be specified");
  try {
    final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
    final FileImport importEntity = getFileImport(applicationId, importId, fileImportId);
    Query query = Query.fromQLNullSafe(ql);
    query.setCursor(cursor);
    query.setConnectionType(FileImportTracker.ERRORS_CONNECTION_NAME);
    query.setResultsLevel(Level.ALL_PROPERTIES);
    //set our entity type
    query.setEntityType(Schema.getDefaultSchema().getEntityType(FailedImportEntity.class));
    return rootEm.searchTargetEntities(importEntity, query);
  } catch (Exception e) {
    throw new RuntimeException("Unable to get import entity", e);
  }
}

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

@Override
public Results getFileImports(final UUID applicationId, final UUID importId,
               @Nullable final String ql, @Nullable final String cursor) {
  Preconditions.checkNotNull(applicationId, "applicationId must be specified");
  Preconditions.checkNotNull(importId, "importId must be specified");
  try {
    final EntityManager rootEm = emf.getEntityManager(emf.getManagementAppId());
    final Import importEntity = getImport(applicationId, importId);
    Query query = Query.fromQLNullSafe(ql);
    query.setCursor(cursor);
    query.setConnectionType(IMPORT_FILE_INCLUDES_CONNECTION);
    query.setResultsLevel(Level.ALL_PROPERTIES);
    //set our entity type
    query.setEntityType(Schema.getDefaultSchema().getEntityType(FileImport.class));
    return rootEm.searchTargetEntities(importEntity, query);
  } catch (Exception e) {
    throw new RuntimeException("Unable to get import entity", e);
  }
}

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

Query query = new Query().fromQLNullSafe("");
query.setLimit(1);
String enityName1 = result.getEntity().getProperty("email").toString();
Query newquery = new Query().fromQLNullSafe("");
query.setCursor(result.getCursor());
result = app.testRequest(ServiceAction.GET,1,"users","conn-user1","connecting","likes",query);
newquery = new Query().fromQLNullSafe("");
query.setCursor(result.getCursor());
result = app.testRequest(ServiceAction.GET,0,"users","conn-user1","connecting","likes",query);

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

Query query = Query.fromQLNullSafe("" );
query.setConnectionType( "likes" );

相关文章