org.opencb.commons.datastore.core.Query.getAsLongList()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(102)

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

Query.getAsLongList介绍

暂无

代码示例

代码示例来源:origin: opencb/opencga

idList = query.getAsLongList(PRIVATE_UID);
} else {
  idList = query.getAsStringList(idQueried);

代码示例来源:origin: org.opencb.commons/commons-datastore-core

case INTEGER_ARRAY:
case LONG_ARRAY:
  put(queryParam.key(), getAsLongList(queryParam.key()));
  break;
case DECIMAL:

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<Panel> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  String userId = userManager.getUserId(sessionId);
  long studyUid;
  if (studyStr.equals(INSTALLATION_PANELS)) {
    studyUid = -1;
  } else {
    studyUid = catalogManager.getStudyManager().resolveId(studyStr, userId).getUid();
  }
  QueryResult<Panel> panelQueryResult = search(studyStr, query, options, sessionId);
  if (panelQueryResult.getNumResults() == 0 && query.containsKey(PanelDBAdaptor.QueryParams.UID.key())) {
    List<Long> panelIds = query.getAsLongList(PanelDBAdaptor.QueryParams.UID.key());
    for (Long panelId : panelIds) {
      authorizationManager.checkPanelPermission(studyUid, panelId, userId,
          PanelAclEntry.PanelPermissions.VIEW);
    }
  }
  return panelQueryResult;
}

代码示例来源:origin: opencb/opencga

List<Long> projectUids = query.getAsLongList(QueryParams.UID.key());
Query studyQuery = new Query();
if (projectUids != null && projectUids.size() > 0) {

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<ClinicalAnalysis> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = catalogManager.getUserManager().getUserId(sessionId);
  Study study = catalogManager.getStudyManager().resolveId(studyStr, userId);
  query.append(ClinicalAnalysisDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  QueryResult<ClinicalAnalysis> queryResult = clinicalDBAdaptor.get(query, options, userId);
  if (queryResult.getNumResults() == 0 && query.containsKey(ClinicalAnalysisDBAdaptor.QueryParams.UID.key())) {
    List<Long> analysisList = query.getAsLongList(ClinicalAnalysisDBAdaptor.QueryParams.UID.key());
    for (Long analysisId : analysisList) {
      authorizationManager.checkClinicalAnalysisPermission(study.getUid(), analysisId, userId,
          ClinicalAnalysisAclEntry.ClinicalAnalysisPermissions.VIEW);
    }
  }
  return queryResult;
}

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<Job> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = userManager.getUserId(sessionId);
  Study study = catalogManager.getStudyManager().resolveId(studyStr, userId);
  query.put(JobDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  fixQueryObject(study, query, sessionId);
  QueryResult<Job> jobQueryResult = jobDBAdaptor.get(query, options, userId);
  if (jobQueryResult.getNumResults() == 0 && query.containsKey(JobDBAdaptor.QueryParams.UID.key())) {
    List<Long> idList = query.getAsLongList(JobDBAdaptor.QueryParams.UID.key());
    for (Long myId : idList) {
      authorizationManager.checkJobPermission(study.getUid(), myId, userId, JobAclEntry.JobPermissions.VIEW);
    }
  }
  return jobQueryResult;
}

代码示例来源:origin: org.opencb.commons/commons-datastore-mongodb

case LONG:
case LONG_ARRAY:
  filter = createFilter(mongoDbField, query.getAsLongList(queryParam, getLogicalSeparator(operator)), comparator,
      operator);
  break;

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<File> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = userManager.getUserId(sessionId);
  Study study = catalogManager.getStudyManager().resolveId(studyStr, userId, new QueryOptions(QueryOptions.INCLUDE,
      StudyDBAdaptor.QueryParams.VARIABLE_SET.key()));
  query.append(FileDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  // Fix query if it contains any annotation
  AnnotationUtils.fixQueryAnnotationSearch(study, query);
  fixQueryObject(study, query, sessionId);
  QueryResult<File> fileQueryResult = fileDBAdaptor.get(query, options, userId);
  if (fileQueryResult.getNumResults() == 0 && query.containsKey(FileDBAdaptor.QueryParams.UID.key())) {
    List<Long> idList = query.getAsLongList(FileDBAdaptor.QueryParams.UID.key());
    for (Long myId : idList) {
      authorizationManager.checkFilePermission(study.getUid(), myId, userId, FileAclEntry.FilePermissions.VIEW);
    }
  }
  return fileQueryResult;
}

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<Sample> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = userManager.getUserId(sessionId);
  Study study = studyManager.resolveId(studyStr, userId, new QueryOptions(QueryOptions.INCLUDE,
      StudyDBAdaptor.QueryParams.VARIABLE_SET.key()));
  fixQueryObject(study, query, sessionId);
  // Fix query if it contains any annotation
  AnnotationUtils.fixQueryAnnotationSearch(study, query);
  AnnotationUtils.fixQueryOptionAnnotation(options);
  query.append(SampleDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  QueryResult<Sample> sampleQueryResult = sampleDBAdaptor.get(query, options, userId);
  if (sampleQueryResult.getNumResults() == 0 && query.containsKey(SampleDBAdaptor.QueryParams.UID.key())) {
    List<Long> sampleIds = query.getAsLongList(SampleDBAdaptor.QueryParams.UID.key());
    for (Long sampleId : sampleIds) {
      authorizationManager.checkSamplePermission(study.getUid(), sampleId, userId, SampleAclEntry.SamplePermissions.VIEW);
    }
  }
  return sampleQueryResult;
}

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<Individual> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = userManager.getUserId(sessionId);
  Study study = studyManager.resolveId(studyStr, userId, new QueryOptions(QueryOptions.INCLUDE,
      StudyDBAdaptor.QueryParams.VARIABLE_SET.key()));
  // Fix query if it contains any annotation
  AnnotationUtils.fixQueryAnnotationSearch(study, query);
  AnnotationUtils.fixQueryOptionAnnotation(options);
  fixQuery(study, query, sessionId);
  query.append(IndividualDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  QueryResult<Individual> individualQueryResult = individualDBAdaptor.get(query, options, userId);
  if (individualQueryResult.getNumResults() == 0 && query.containsKey(IndividualDBAdaptor.QueryParams.UID.key())) {
    List<Long> idList = query.getAsLongList(IndividualDBAdaptor.QueryParams.UID.key());
    for (Long myId : idList) {
      authorizationManager.checkIndividualPermission(study.getUid(), myId, userId, IndividualAclEntry.IndividualPermissions.VIEW);
    }
  }
  return individualQueryResult;
}

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<Family> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = userManager.getUserId(sessionId);
  Study study = catalogManager.getStudyManager().resolveId(studyStr, userId, new QueryOptions(QueryOptions.INCLUDE,
      StudyDBAdaptor.QueryParams.VARIABLE_SET.key()));
  // Fix query if it contains any annotation
  AnnotationUtils.fixQueryAnnotationSearch(study, query);
  AnnotationUtils.fixQueryOptionAnnotation(options);
  query.append(FamilyDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  QueryResult<Family> familyQueryResult = familyDBAdaptor.get(query, options, userId);
  if (familyQueryResult.getNumResults() == 0 && query.containsKey(FamilyDBAdaptor.QueryParams.UID.key())) {
    List<Long> idList = query.getAsLongList(FamilyDBAdaptor.QueryParams.UID.key());
    for (Long myId : idList) {
      authorizationManager.checkFamilyPermission(study.getUid(), myId, userId, FamilyAclEntry.FamilyPermissions.VIEW);
    }
  }
  return familyQueryResult;
}

代码示例来源:origin: opencb/opencga

@Override
public QueryResult<Cohort> get(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException {
  query = ParamUtils.defaultObject(query, Query::new);
  options = ParamUtils.defaultObject(options, QueryOptions::new);
  String userId = userManager.getUserId(sessionId);
  Study study = catalogManager.getStudyManager().resolveId(studyStr, userId, new QueryOptions(QueryOptions.INCLUDE,
      StudyDBAdaptor.QueryParams.VARIABLE_SET.key()));
  // Fix query if it contains any annotation
  AnnotationUtils.fixQueryAnnotationSearch(study, query);
  AnnotationUtils.fixQueryOptionAnnotation(options);
  fixQueryObject(study, query, sessionId);
  query.append(CohortDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid());
  QueryResult<Cohort> cohortQueryResult = cohortDBAdaptor.get(query, options, userId);
  if (cohortQueryResult.getNumResults() == 0 && query.containsKey(CohortDBAdaptor.QueryParams.UID.key())) {
    List<Long> idList = query.getAsLongList(CohortDBAdaptor.QueryParams.UID.key());
    for (Long myId : idList) {
      authorizationManager.checkCohortPermission(study.getUid(), myId, userId, CohortAclEntry.CohortPermissions.VIEW);
    }
  }
  return cohortQueryResult;
}

相关文章