本文整理汇总了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
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
}