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


Java CQLQuery.setTarget方法代码示例

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


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

示例1: formulateCqlQueryWithAssociations

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private CQLQuery formulateCqlQueryWithAssociations() {
    CQLQuery cqlQuery = new CQLQuery();

    // Set the target object to Protocol.
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName("gov.nih.nci.caarray.domain.protocol.Protocol");

    // Set the protocol's "type" association to a Term with a certain value.
    Association type = new Association();
    type.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
    type.setRoleName("type");
    Attribute termValue = new Attribute();
    termValue.setName("value");
    termValue.setValue(DUMMY_TERM_1.getValue());
    termValue.setPredicate(Predicate.EQUAL_TO);
    type.setAttribute(termValue);
    target.setAssociation(type);
    
    // Set the target for the query.
    cqlQuery.setTarget(target);
    return cqlQuery;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:23,代码来源:SearchDaoTest.java

示例2: testQueryPqUnit

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryPqUnit() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(PqDataType.class.getName());
    Association association1 = new Association();
    association1.setName(Pq.class.getName());
    association1.setRoleName("value1");
    target.setAssociation(association1);
    Attribute attribute2 = new Attribute();
    attribute2.setName("unit");
    attribute2.setPredicate(Predicate.IS_NOT_NULL);
    association1.setAttribute(attribute2);
    query.setTarget(target);

    Iterator<?> iter = executeQuery(query).iterator();
    ArrayList<gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType> result = new ArrayList<gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType>();
    while (iter.hasNext()) {
        result.add((gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType) iter.next());
    }
    gov.nih.nci.cacoresdk.domain.other.datatype.PqDataType testResultClass = result.get(0);
    assertEquals(5, result.size());
    assertEquals("GALLON", testResultClass.getValue1().getUnit().toString());
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:24,代码来源:Cql2IsoQueriesTestCase.java

示例3: testQueryDsetIiDataTypeAgainstConstant

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryDsetIiDataTypeAgainstConstant() {
    CQLQuery query = new CQLQuery();
    Object target = new Object();
    target.setName(DsetIiDataType.class.getName());
    Association a1 = new Association();
    a1.setName(DSet.class.getName());
    a1.setRoleName("value1");
    Association a2 = new Association();
    a2.setName(Ii.class.getName());
    a2.setRoleName("item");
    a2.setAttribute(new Attribute("root", Predicate.EQUAL_TO, "2.16.12.123.456"));
    a1.setAssociation(a2);
    target.setAssociation(a1);
    query.setTarget(target);

    executeQuery(query);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:18,代码来源:IsoQueriesTestCase.java

示例4: testQueryAdDataType

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryAdDataType() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(AdDataType.class.getName());
    Association assoc1 = new Association();
    assoc1.setName(Ad.class.getName());
    assoc1.setRoleName("value1");
    Association assoc2 = new Association();
    assoc2.setName(Adxp.class.getName());
    assoc2.setRoleName("part");
    Attribute attrib = new Attribute("value", Predicate.LIKE, "%1");
    assoc2.setAttribute(attrib);
    assoc1.setAssociation(assoc2);
    target.setAssociation(assoc1);
    query.setTarget(target);

    executeQuery(query);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:IsoQueriesTestCase.java

示例5: testQueryIiRootAttribute

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryIiRootAttribute() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(IiDataType.class.getName());
    Association association1 = new Association();
    association1.setName(Ii.class.getName());
    association1.setRoleName("value2");
    target.setAssociation(association1);
    Attribute attribute2 = new Attribute();
    attribute2.setName("root");
    attribute2.setPredicate(Predicate.IS_NOT_NULL);
    attribute2.setValue("true");
    association1.setAttribute(attribute2);
    query.setTarget(target);

    Iterator<?> iter = executeQuery(query).iterator();
    ArrayList<IiDataType> result = new ArrayList<IiDataType>();
    while (iter.hasNext()) {
        result.add((IiDataType) iter.next());
    }
    IiDataType testResultClass = result.get(0);
    assertEquals(2, result.size());
    assertEquals("II_VALUE2_ROOT", testResultClass.getValue2().getRoot().toString());
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:Cql2IsoQueriesTestCase.java

示例6: createCqlQuery

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

    Association providerAssociation = new Association();
    providerAssociation.setName("gov.nih.nci.caarray.domain.contact.Organization");
    Attribute providerAttribute = new Attribute();
    providerAttribute.setName("name");
    providerAttribute.setValue(provider);
    providerAttribute.setPredicate(Predicate.EQUAL_TO);
    providerAssociation.setAttribute(providerAttribute);
    providerAssociation.setRoleName("provider");

    target.setAssociation(providerAssociation);

    cqlQuery.setTarget(target);
    return cqlQuery;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:20,代码来源:CQLSearchArrayDesign.java

示例7: testQueryBlNonNullValue

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryBlNonNullValue() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(BlNonNullDataType.class.getName());
    Association association1 = new Association();
    association1.setName(BlNonNull.class.getName());
    association1.setRoleName("value1");
    target.setAssociation(association1);
    Attribute attribute2 = new Attribute();
    attribute2.setName("value");
    attribute2.setPredicate(Predicate.EQUAL_TO);
    attribute2.setValue("false");
    association1.setAttribute(attribute2);
    query.setTarget(target);

    Iterator<?> iter = executeQuery(query).iterator();
    ArrayList<BlNonNullDataType> result = new ArrayList<BlNonNullDataType>();
    while (iter.hasNext()) {
        result.add((BlNonNullDataType) iter.next());
    }
    BlNonNullDataType testResultClass = result.get(0);
    assertEquals(1, result.size());
    assertEquals(testResultClass.getValue1().getValue().booleanValue(), false);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:Cql2IsoQueriesTestCase.java

示例8: queryForInvalidClass

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private void queryForInvalidClass(EnumerationDataServiceClient client) throws Exception {
	CQLQuery query = new CQLQuery();
	gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
	target.setName("non.existant.class");
	query.setTarget(target);
	EnumerationResponseContainer enumContainer = null;
	try {
		enumContainer = client.enumerationQuery(query);
	} catch (QueryProcessingExceptionType ex) {
		assertTrue("Query Processing Exception Type thrown", true);
	} finally {
		if (enumContainer != null && enumContainer.getContext() != null) {
			Release release = new Release();
			release.setEnumerationContext(enumContainer.getContext());
               createDataSource(enumContainer.getEPR()).releaseOp(release);
		}
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:InvokeEnumerationDataServiceStep.java

示例9: 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

示例10: testQueryEnDataType

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryEnDataType() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(EnDataType.class.getName());
    Association assoc1 = new Association();
    assoc1.setName(En.class.getName());
    assoc1.setRoleName("value5");
    Association assoc2 = new Association();
    assoc2.setName(Enxp.class.getName());
    assoc2.setRoleName("part");
    Attribute attrib = new Attribute("value", Predicate.EQUAL_TO, "Mr. John Doe1");
    assoc2.setAttribute(attrib);
    assoc1.setAssociation(assoc2);
    target.setAssociation(assoc1);
    query.setTarget(target);

    executeQuery(query);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:IsoQueriesTestCase.java

示例11: createCqlQuery

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

    Association statusAssociation = new Association();
    statusAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
    Attribute statusAttribute = new Attribute();
    statusAttribute.setName("value");
    statusAttribute.setValue(publicationStatus);
    statusAttribute.setPredicate(Predicate.EQUAL_TO);
    statusAssociation.setAttribute(statusAttribute);
    statusAssociation.setRoleName("status");

    Association typeAssociation = new Association();
    typeAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
    Attribute typeAttribute = new Attribute();
    typeAttribute.setName("value");
    typeAttribute.setValue(publicationType);
    typeAttribute.setPredicate(Predicate.EQUAL_TO);
    typeAssociation.setAttribute(typeAttribute);
    typeAssociation.setRoleName("type");

    Group associations = new Group();
    associations.setAssociation(new Association[] {statusAssociation, typeAssociation});
    associations.setLogicRelation(LogicalOperator.AND);
    target.setGroup(associations);

    cqlQuery.setTarget(target);
    return cqlQuery;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:32,代码来源:CQLSearchPublication.java

示例12: loadKeywordsForFile

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
private void loadKeywordsForFile(File file) {
	CQLQuery query = new CQLQuery();
	gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
	target.setName("gov.nih.nci.cananolab.domain.common.Keyword");
	Association association = new Association();
	association.setName("gov.nih.nci.cananolab.domain.common.File");
	association.setRoleName("fileCollection");

	Attribute attribute = new Attribute();
	attribute.setName("id");
	attribute.setPredicate(Predicate.EQUAL_TO);
	attribute.setValue(file.getId().toString());
	association.setAttribute(attribute);
	target.setAssociation(association);
	query.setTarget(target);
	try {
		CQLQueryResults results = gridClient.query(query);
		results
				.setTargetClassname("gov.nih.nci.cananolab.domain.common.Keyword");
		CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
		file.setKeywordCollection(new HashSet<Keyword>());
		while (iter.hasNext()) {
			java.lang.Object obj = iter.next();
			Keyword keyword = (Keyword) obj;
			if (keyword != null) {
				System.out.println("Keyword id=" + keyword.getId()
						+ "\tName=" + keyword.getName());
				builder.append("Keyword id=" + keyword.getId()
						+ "\tName=" + keyword.getName() + "\n");
			}
			file.getKeywordCollection().add(keyword);
		}
	} catch (Exception e) {
		System.out.println("Exception getting keyword for file id="
				+ file.getId() + ": " + e);
		builder.append("Exception getting keyword for file id="
				+ file.getId() + ": " + e + "\n");
	}
}
 
开发者ID:NCIP,项目名称:cananolab,代码行数:40,代码来源:GridClientTest.java

示例13: createCqlQuery

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

    Attribute hybridizationNameAttribute = new Attribute();
    hybridizationNameAttribute.setName("name");
    hybridizationNameAttribute.setValue(hybridizationName);
    hybridizationNameAttribute.setPredicate(Predicate.EQUAL_TO);

    target.setAttribute(hybridizationNameAttribute);

    cqlQuery.setTarget(target);
    return cqlQuery;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:16,代码来源:CQLSearchHybridization.java

示例14: testQueryCdDataTypeAgainstConstant

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryCdDataTypeAgainstConstant() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(CdDataType.class.getName());
    Association assoc = new Association();
    assoc.setName(Cd.class.getName());
    assoc.setRoleName("value3");
    Attribute attrib = new Attribute("codeSystem", Predicate.EQUAL_TO, "CODESYSTEM");
    assoc.setAttribute(attrib);
    target.setAssociation(assoc);
    query.setTarget(target);

    executeQuery(query);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:15,代码来源:Cql2IsoQueriesTestCase.java

示例15: testQueryDsetCdEdTextOriginalText

import gov.nih.nci.cagrid.cqlquery.CQLQuery; //导入方法依赖的package包/类
public void testQueryDsetCdEdTextOriginalText() {
    CQLQuery query = new CQLQuery();
    gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
    target.setName(DsetCdDataType.class.getName());
    Association association1 = new Association();
    association1.setName(DSet.class.getName());
    association1.setRoleName("value4");
    target.setAssociation(association1);
    Association association2 = new Association();
    association2.setName(Cd.class.getName());
    association2.setRoleName("item");
    association1.setAssociation(association2);
    Association association3 = new Association();
    association3.setName(EdText.class.getName());
    association3.setRoleName("originalText");
    //association3.setAttribute(new Attribute("value", Predicate.IS_NOT_NULL, "true"));
    association2.setAssociation(association3);
    query.setTarget(target);
    
    Iterator<?> iter = executeQuery(query).iterator();
    ArrayList<DsetCdDataType> result = new ArrayList<DsetCdDataType>();
    while (iter.hasNext()) {
        result.add((DsetCdDataType)iter.next());
    }
    DsetCdDataType testResultClass = result.get(0);
    assertEquals(5, result.size());
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:28,代码来源:IsoQueriesTestCase.java


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