当前位置: 首页>>代码示例>>Java>>正文


Java CQLQuery.setQueryModifier方法代码示例

本文整理汇总了Java中gov.nih.nci.cagrid.cqlquery.CQLQuery.setQueryModifier方法的典型用法代码示例。如果您正苦于以下问题:Java CQLQuery.setQueryModifier方法的具体用法?Java CQLQuery.setQueryModifier怎么用?Java CQLQuery.setQueryModifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nih.nci.cagrid.cqlquery.CQLQuery的用法示例。


在下文中一共展示了CQLQuery.setQueryModifier方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCqlSearchWithCount

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
/**
 * Tests searching for an entity using CQL, where the search involves associations.
 */
@Test
public void testCqlSearchWithCount() {
    saveSupportingObjects();
    CQLQuery cqlQuery = formulateCqlQueryWithAssociations();
    QueryModifier modifier = new QueryModifier();
    modifier.setCountOnly(true);
    cqlQuery.setQueryModifier(modifier);

    Transaction tx = null;
    try {
        tx = hibernateHelper.beginTransaction();
        List<?> results = SEARCH_DAO.query(cqlQuery);
        assertEquals(1, results.size());
        assertEquals(1L, results.get(0));
        tx.commit();
    } catch (DAOException e) {
        hibernateHelper.rollbackTransaction(tx);
        fail("DAO exception during CQL search: " + e.getMessage());
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:24,代码来源:SearchDaoTest.java

示例2: retrieveAllCollectionNameProjects

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<String> retrieveAllCollectionNameProjects() throws ConnectionException {
    List<String> collectionNameProjectsCollection = new ArrayList<String>();
    final CQLQuery query = new CQLQuery();
    Object target = new Object();
    target.setName("gov.nih.nci.ncia.domain.TrialDataProvenance");
    query.setTarget(target);
    QueryModifier distinctProjectModifier = new QueryModifier();
    distinctProjectModifier.setCountOnly(false);
    distinctProjectModifier.setDistinctAttribute("project");
    query.setQueryModifier(distinctProjectModifier);

    CQLQueryResults result = connectAndExecuteQuery(query);
    // Iterate Results
    if (result != null) {
        CQLQueryResultsIterator iter2 = new CQLQueryResultsIterator(result);
        while (iter2.hasNext()) {
            TargetAttribute[] obj = (TargetAttribute[]) iter2.next();
            //LOGGER.info(obj[0].getValue());
            collectionNameProjectsCollection.add(obj[0].getValue());
        }
    }
    return collectionNameProjectsCollection;
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:28,代码来源:NCIASearchServiceImpl.java

示例3: retrieveAllSeriesIdentifiers

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
List<String> retrieveAllSeriesIdentifiers() throws ConnectionException {
    List<String> imageSeriesIdentifiers = new ArrayList<String>();
    final CQLQuery query = new CQLQuery();
    Object target = new Object();
    target.setName("edu.northwestern.radiology.aim.Series");
    query.setTarget(target);
    QueryModifier distinctProjectModifier = new QueryModifier();
    distinctProjectModifier.setCountOnly(false);
    distinctProjectModifier.setDistinctAttribute("instanceUID");
    query.setQueryModifier(distinctProjectModifier);

    CQLQueryResults result = connectAndExecuteQuery(query);
    if (result != null) {
        CQLQueryResultsIterator iter2 = new CQLQueryResultsIterator(result);
        while (iter2.hasNext()) {
            TargetAttribute[] obj = (TargetAttribute[]) iter2.next();
            imageSeriesIdentifiers.add(obj[0].getValue());
        }
    }
    return imageSeriesIdentifiers;
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:22,代码来源:AIMSearchServiceImpl.java

示例4: getQueryFromApi

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
@Override
public CQLQuery getQueryFromApi(CbmObject object, String... strings) throws Exception {

   CQLQuery query = new gov.nih.nci.cagrid.cqlquery.CQLQuery();

   gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
   target.setName(object.getCbmClass().getName());
   query.setTarget(target);

   QueryModifier mod = new QueryModifier();
   mod.setCountOnly(true);
   query.setQueryModifier(mod);

   return query;
}
 
开发者ID:NCIP,项目名称:common-biorepository-model,代码行数:16,代码来源:ObjectCountQueryBuilder.java

示例5: convertToCql1Query

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public static CQLQuery convertToCql1Query(org.cagrid.cql2.CQLQuery cql2Query) throws QueryConversionException {
    assertNoAssociationPopulation(cql2Query);
    assertValidAggregation(cql2Query);
    
    CQLQuery query = new CQLQuery();
    Object target = convertObject(cql2Query.getCQLTargetObject());
    query.setTarget(target);
    
    if (cql2Query.getCQLQueryModifier() != null) {
        QueryModifier mods = convertQueryModifier(cql2Query.getCQLQueryModifier());
        query.setQueryModifier(mods);
    }
    
    return query;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:16,代码来源:CQL2toCQL1Converter.java

示例6: createCqlQuery

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private CQLQuery createCqlQuery(String arrayDesignName) {
    CQLQuery cqlQuery = new CQLQuery();
    Object target = new Object();
    target.setName("gov.nih.nci.caarray.domain.data.HybridizationData");

    Association hybAssociation = new Association();
    hybAssociation.setName("gov.nih.nci.caarray.domain.hybridization.Hybridization");
    hybAssociation.setRoleName("hybridization");
    target.setAssociation(hybAssociation);

    Association arrayAssociation = new Association();
    arrayAssociation.setName("gov.nih.nci.caarray.domain.array.Array");
    arrayAssociation.setRoleName("array");
    hybAssociation.setAssociation(arrayAssociation);

    Association arrayDesignAssociation = new Association();
    arrayDesignAssociation.setName("gov.nih.nci.caarray.domain.array.ArrayDesign");
    arrayDesignAssociation.setRoleName("design");
    arrayAssociation.setAssociation(arrayDesignAssociation);
    
    Association orgAssociation = new Association();
    orgAssociation.setName("edu.georgetown.pir.Organism");
    orgAssociation.setRoleName("organism");
    arrayDesignAssociation.setAssociation(orgAssociation);

    Attribute nameAttribute = new Attribute();
    nameAttribute.setName("scientificName");
    nameAttribute.setValue("Homo sapiens");
    nameAttribute.setPredicate(Predicate.EQUAL_TO);
    orgAssociation.setAttribute(nameAttribute);
    
    cqlQuery.setTarget(target);
    QueryModifier qm = new QueryModifier();
    qm.setCountOnly(true);
    cqlQuery.setQueryModifier(qm);
    return cqlQuery;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:38,代码来源:GridCqlSearchExperiment.java

示例7: testAbstractDesignElement_Feature

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
@Test
    public void testAbstractDesignElement_Feature() throws RemoteException {
        CQLQuery cqlQuery = new CQLQuery();
        gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
        target.setName("gov.nih.nci.caarray.domain.array.Feature");
        Association assoc = new Association("coordinateUnits");
        assoc.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
        Attribute att = new Attribute("id", Predicate.EQUAL_TO, "321");
        assoc.setAttribute(att);
        Association[] assocs = { assoc };
        Attribute[] atts = {
            new Attribute("featureNumber", Predicate.LESS_THAN, "200"),
            new Attribute("x_Coordinate", Predicate.LESS_THAN, "3"),
            new Attribute("y_Coordinate", Predicate.GREATER_THAN, "0.03")
        };
        Group g = new Group(assocs, atts, null, LogicalOperator.AND);
        target.setGroup(g);
        cqlQuery.setTarget(target);

        QueryModifier qm = new QueryModifier();
        qm.setCountOnly(false);
        cqlQuery.setQueryModifier(qm);

        CQLQueryResults cqlResults = gridClient.query(cqlQuery);
//        assertEquals("this will fail due to http://gforge.nci.nih.gov/tracker/index.php?func=detail&aid=28685", 48, cqlResults.getObjectResult().length);
        Iterator iter = new CQLQueryResultsIterator(cqlResults, CaArraySvcClient.class.getResourceAsStream("client-config.wsdd"));
        while (iter.hasNext()) {
            Feature f = (Feature) (iter.next());
            assertEquals(321L, f.getCoordinateUnits().getId().longValue());
//            assertTrue(f.getFeatureNumber().intValue() < 200);
//            assertTrue(f.getX_Coordinate().doubleValue() < 3.0);
//            assertTrue(f.getY_Coordinate().doubleValue() > 0.03);
        }
    }
 
开发者ID:NCIP,项目名称:caarray,代码行数:35,代码来源:ModelApiTest.java

示例8: retrievePatientCollectionIdsFromCollectionNameProject

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<String> retrievePatientCollectionIdsFromCollectionNameProject(String collectionNameProject)
throws ConnectionException {
    CQLQuery fcqlq = retrieveQueryForPatients(collectionNameProject);
    fcqlq.setQueryModifier(retrieveQueryModifierForProperty("patientId"));
    CQLQueryResults result = connectAndExecuteQuery(fcqlq);
    return iterateAndRetrieveResults(result, String.class);
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:12,代码来源:NCIASearchServiceImpl.java

示例9: retrieveStudyCollectionIdsFromPatient

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<String> retrieveStudyCollectionIdsFromPatient(String patientId)
throws ConnectionException {
    CQLQuery fcqlq = retrieveQueryForStudies(patientId);
    fcqlq.setQueryModifier(retrieveQueryModifierForProperty("studyInstanceUID"));
    CQLQueryResults result = connectAndExecuteQuery(fcqlq);
    return iterateAndRetrieveResults(result, String.class);
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:12,代码来源:NCIASearchServiceImpl.java

示例10: retrieveImageSeriesCollectionIdsFromStudy

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<String> retrieveImageSeriesCollectionIdsFromStudy(String studyInstanceUID)
throws ConnectionException {
    CQLQuery fcqlq = retrieveQueryForImageSeries(studyInstanceUID);
    fcqlq.setQueryModifier(retrieveQueryModifierForProperty(nbiaVersion.getSeriesIdAtt()));
    CQLQueryResults result = connectAndExecuteQuery(fcqlq);
    return iterateAndRetrieveResults(result, String.class);
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:12,代码来源:NCIASearchServiceImpl.java

示例11: retrieveImageCollectionIdsFromSeries

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<String> retrieveImageCollectionIdsFromSeries(String seriesInstanceUID)
throws ConnectionException {
    CQLQuery fcqlq = retrieveQueryForImages(seriesInstanceUID);
    fcqlq.setQueryModifier(retrieveQueryModifierForProperty("sopInstanceUID"));
    CQLQueryResults result = connectAndExecuteQuery(fcqlq);
    return iterateAndRetrieveResults(result, String.class);
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:12,代码来源:NCIASearchServiceImpl.java


注:本文中的gov.nih.nci.cagrid.cqlquery.CQLQuery.setQueryModifier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。