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


Java Group.setLogicRelation方法代码示例

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


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

示例1: submitMalformedQuery

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private void submitMalformedQuery(DataServiceClient client) throws Exception {
	CQLQuery query = new CQLQuery();
	Object target = new Object();
	target.setName(Book.class.getName());
	Attribute attrib1 = new Attribute("name", Predicate.LIKE, "E%");
	target.setAttribute(attrib1);
	Group group = new Group();
	group.setLogicRelation(LogicalOperator.AND);
	group.setAttribute(new Attribute[] {
		new Attribute("author", Predicate.IS_NOT_NULL, ""),
		new Attribute("ISBN", Predicate.IS_NULL, "")
	});
	target.setGroup(group);
	query.setTarget(target);
	try {
		client.query(query);
		fail("Exception MalformedQueryExceptionType should have been thrown");
	} catch (MalformedQueryExceptionType ex) {
		// expected
	}		
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:InvokeDataServiceStep.java

示例2: submitMalformedQuery

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private void submitMalformedQuery(EnumerationDataServiceClient client) throws Exception {
	CQLQuery query = new CQLQuery();
	gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
	target.setName(Book.class.getName());
	Attribute attrib1 = new Attribute("name", Predicate.LIKE, "E%");
	target.setAttribute(attrib1);
	Group group = new Group();
	group.setLogicRelation(LogicalOperator.AND);
	group.setAttribute(new Attribute[] {
		new Attribute("author", Predicate.IS_NOT_NULL, ""),
		new Attribute("ISBN", Predicate.IS_NULL, "")
	});
	target.setGroup(group);
	query.setTarget(target);
	EnumerationResponseContainer enumContainer = null;
	try {
		enumContainer = client.enumerationQuery(query);
	} catch (MalformedQueryExceptionType ex) {
		assertTrue("Malformed Query 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,代码行数:28,代码来源:InvokeEnumerationDataServiceStep.java

示例3: convertGroup

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private static Group convertGroup(CQLGroup cql2Group) throws QueryConversionException {
    if (cql2Group.getCQLExtension() != null) {
        throw new QueryConversionException("CQL 1 does not support query extensions");
    }
    Group group = new Group();
    group.setLogicRelation(cql2Group.getLogicalOperation() == GroupLogicalOperator.AND 
        ? LogicalOperator.AND : LogicalOperator.OR);
    if (cql2Group.getCQLAssociatedObject() != null) {
        Association[] associations = new Association[cql2Group.getCQLAssociatedObject().length];
        for (int i = 0; i < cql2Group.getCQLAssociatedObject().length; i++) {
            associations[i] = convertAssociation(cql2Group.getCQLAssociatedObject(i));
        }
        group.setAssociation(associations);
    }
    if (cql2Group.getCQLAttribute() != null) {
        Attribute[] attributes = new Attribute[cql2Group.getCQLAttribute().length];
        for (int i = 0; i < cql2Group.getCQLAttribute().length; i++) {
            attributes[i] = convertAttribute(cql2Group.getCQLAttribute(i));
        }
        group.setAttribute(attributes);
    }
    if (cql2Group.getCQLGroup() != null) {
        Group[] groups = new Group[cql2Group.getCQLGroup().length];
        for (int i = 0; i < cql2Group.getCQLGroup().length; i++) {
            groups[i] = convertGroup(cql2Group.getCQLGroup(i));
        }
        group.setGroup(groups);
    }
    return group;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:31,代码来源:CQL2toCQL1Converter.java

示例4: createCqlQuery

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

    Association arrayDesignAssociation = new Association();
    arrayDesignAssociation.setName("gov.nih.nci.caarray.domain.array.ArrayDesign");
    Attribute nameAttribute = new Attribute();
    nameAttribute.setName("name");
    nameAttribute.setValue(arrayDesignName);
    nameAttribute.setPredicate(Predicate.EQUAL_TO);
    arrayDesignAssociation.setAttribute(nameAttribute);
    arrayDesignAssociation.setRoleName("arrayDesigns");

    Association experimentDesignAssociation = new Association();
    experimentDesignAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
    Attribute valueAttribute = new Attribute();
    valueAttribute.setName("value");
    valueAttribute.setValue(EXPERIMENTAL_DESIGN);
    valueAttribute.setPredicate(Predicate.EQUAL_TO);
    experimentDesignAssociation.setAttribute(valueAttribute);
    experimentDesignAssociation.setRoleName("experimentDesignTypes");

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

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

示例5: createCqlQuery

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
private CQLQuery createCqlQuery(String manufacturerName, String organismName) {
    CQLQuery cqlQuery = new CQLQuery();
    Object target = new Object();
    target.setName("gov.nih.nci.caarray.domain.project.Experiment");

    Association manufacturerAssociation = new Association();
    manufacturerAssociation.setName("gov.nih.nci.caarray.domain.contact.Organization");
    Attribute manufacturerAttribute = new Attribute();
    manufacturerAttribute.setName("name");
    manufacturerAttribute.setValue(manufacturerName);
    manufacturerAttribute.setPredicate(Predicate.EQUAL_TO);
    manufacturerAssociation.setAttribute(manufacturerAttribute);
    manufacturerAssociation.setRoleName("manufacturer");

    Association organismAssociation = new Association();
    organismAssociation.setName("edu.georgetown.pir.Organism");
    Attribute organismAttribute = new Attribute();
    organismAttribute.setName("commonName");
    organismAttribute.setValue(organismName);
    organismAttribute.setPredicate(Predicate.EQUAL_TO);
    organismAssociation.setAttribute(organismAttribute);
    organismAssociation.setRoleName("organism");

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

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

示例6: createCqlQuery

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

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

    Association organismAssociation = new Association();
    organismAssociation.setName("edu.georgetown.pir.Organism");
    Attribute organismName = new Attribute();
    organismName.setName("commonName");
    organismName.setValue(organism);
    organismName.setPredicate(Predicate.EQUAL_TO);
    organismAssociation.setAttribute(organismName);
    organismAssociation.setRoleName("organism");

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

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

示例7: createCqlQuery

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

    Attribute sourceNameAttribute = new Attribute();
    sourceNameAttribute.setName("name");
    sourceNameAttribute.setValue(sourceName);
    sourceNameAttribute.setPredicate(Predicate.EQUAL_TO);

    Association materialTypeAssociation = new Association();
    materialTypeAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
    Attribute materialTypeAttribute = new Attribute();
    materialTypeAttribute.setName("value");
    materialTypeAttribute.setValue(materialType);
    materialTypeAttribute.setPredicate(Predicate.EQUAL_TO);
    materialTypeAssociation.setAttribute(materialTypeAttribute);
    materialTypeAssociation.setRoleName("materialType");

    Group associations = new Group();
    associations.setAttribute(new Attribute[] {sourceNameAttribute});
    associations.setAssociation(new Association[] {materialTypeAssociation});
    associations.setLogicRelation(LogicalOperator.AND);
    target.setGroup(associations);

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

示例8: createCqlQuery

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的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

示例9: createCqlQuery

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

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

    Association organismAssociation = new Association();
    organismAssociation.setName("edu.georgetown.pir.Organism");
    Attribute organismName = new Attribute();
    organismName.setName("commonName");
    organismName.setValue(organism);
    organismName.setPredicate(Predicate.EQUAL_TO);
    organismAssociation.setAttribute(organismName);
    organismAssociation.setRoleName("organism");

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

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

示例10: findClassesInPackage

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
public UMLClassMetadata[] findClassesInPackage(Project project, String packageName) throws RemoteException {
    CQLQuery query = new CQLQuery();

    // looking for UMLClasses
    Object target = new Object();
    query.setTarget(target);
    target.setName(UMLClassMetadata.class.getName());

    // in the specified package
    Association packageAssociation = new Association();
    packageAssociation.setName(UMLPackageMetadata.class.getName());
    Attribute pkgNameAttribute = new Attribute();
    packageAssociation.setAttribute(pkgNameAttribute);
    pkgNameAttribute.setName("name");
    pkgNameAttribute.setPredicate(Predicate.EQUAL_TO);
    pkgNameAttribute.setValue(packageName);

    // with associations to the specified project
    Association projAssociation = new Association();
    projAssociation.setName(Project.class.getName());
    Attribute projIDAttribute = new Attribute();
    projAssociation.setAttribute(projIDAttribute);
    projIDAttribute.setName("id");
    projIDAttribute.setPredicate(Predicate.EQUAL_TO);
    projIDAttribute.setValue(project.getId());

    // our target has both associations
    Group group = new Group();
    target.setGroup(group);
    group.setLogicRelation(LogicalOperator.AND);
    group.setAssociation(new Association[]{projAssociation, packageAssociation});

    CQLQueryResults results = this.client.query(query);

    Iterator iter = new CQLQueryResultsIterator(results, this.getClass().getResourceAsStream("client-config.wsdd"));
    int count = 0;

    List<UMLClassMetadata> classes = new ArrayList<UMLClassMetadata>();
    // iterate and print XML
    while (iter.hasNext()) {
        UMLClassMetadata prj = (UMLClassMetadata) iter.next();
        classes.add(prj);
        count++;
    }

    UMLClassMetadata[] classArray = new UMLClassMetadata[count];
    return classes.toArray(classArray);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:49,代码来源:CaDSRUMLModelService.java

示例11: testDefect10709

import gov.nih.nci.cagrid.cqlquery.Group; //导入方法依赖的package包/类
@Test
public void testDefect10709() {
    saveSupportingObjects();
    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.sample.Sample");

    Attribute sampleNameAttribute = new Attribute();
    sampleNameAttribute.setName("name");
    String sampleName = "sampleName";
    sampleNameAttribute.setValue(sampleName );
    sampleNameAttribute.setPredicate(Predicate.EQUAL_TO);

    Association tissueSiteAssociation = new Association();
    tissueSiteAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
    Attribute tissueSiteAttribute = new Attribute();
    tissueSiteAttribute.setName("value");
    String tissueSite = "tissueSite";
    tissueSiteAttribute.setValue(tissueSite);
    tissueSiteAttribute.setPredicate(Predicate.EQUAL_TO);
    tissueSiteAssociation.setAttribute(tissueSiteAttribute);
    tissueSiteAssociation.setRoleName(tissueSite); // This is the key line

    Group associations = new Group();
    associations.setAttribute(new Attribute[] {sampleNameAttribute});
    associations.setAssociation(new Association[] {tissueSiteAssociation});
    associations.setLogicRelation(LogicalOperator.AND);
    target.setGroup(associations);

    cqlQuery.setTarget(target);

    Transaction tx = null;
    try {
        tx = hibernateHelper.beginTransaction();
        List<?> matchingProtocols = SEARCH_DAO.query(cqlQuery);
        // just making sure it ran through w/o exception or null return
        assertNotNull(matchingProtocols);
        tx.commit();
    } catch (DAOException e) {
        hibernateHelper.rollbackTransaction(tx);
        throw e;
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:44,代码来源:SearchDaoTest.java


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