本文整理汇总了Java中gov.nih.nci.cagrid.cqlresultset.CQLQueryResults.setTargetClassname方法的典型用法代码示例。如果您正苦于以下问题:Java CQLQueryResults.setTargetClassname方法的具体用法?Java CQLQueryResults.setTargetClassname怎么用?Java CQLQueryResults.setTargetClassname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.cqlresultset.CQLQueryResults
的用法示例。
在下文中一共展示了CQLQueryResults.setTargetClassname方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyResults
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private void verifyResults(List<SOAPElement> results) {
LOG.debug("Verifying test results");
LOG.debug("Loading gold results from " + getGoldFilenname());
DCQLQueryResultsCollection goldResults = loadGoldDcqlResults();
// convert the list of elements into DCQL results
DCQLQueryResultsCollection testResults = new DCQLQueryResultsCollection();
DCQLResult testResult = new DCQLResult();
testResult.setTargetServiceURL("http://fake.service");
CQLQueryResults cqlResults = new CQLQueryResults();
// what's the target classname supposed to be?
String targetName = deserializeQuery().getTargetObject().getName();
LOG.debug("Setting test results target classname to " + targetName);
cqlResults.setTargetClassname(targetName);
CQLObjectResult[] objectResults = new CQLObjectResult[results.size()];
for (int i = 0; i < results.size(); i++) {
CQLObjectResult obj = new CQLObjectResult();
obj.set_any(new MessageElement[] {new MessageElement(results.get(i))});
objectResults[i] = obj;
}
cqlResults.setObjectResult(objectResults);
testResult.setCQLQueryResultCollection(cqlResults);
testResults.setDCQLResult(new DCQLResult[] {testResult});
QueryResultsVerifier.verifyDcqlResults(testResults, goldResults);
}
示例2: aggregateDCQLResults
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
public static CQLQueryResults aggregateDCQLResults(
DCQLQueryResultsCollection dcqlResults, String targetClassname) {
List<CQLObjectResult> objectResults = new LinkedList<CQLObjectResult>();
for (DCQLResult result : dcqlResults.getDCQLResult()) {
CQLObjectResult[] objects = result.getCQLQueryResultCollection().getObjectResult();
if (objects != null && objects.length != 0) {
Collections.addAll(objectResults, objects);
}
}
// generate the aggregate query result
CQLQueryResults aggregate = new CQLQueryResults();
CQLObjectResult[] resultArray = new CQLObjectResult[objectResults.size()];
objectResults.toArray(resultArray);
aggregate.setObjectResult(resultArray);
aggregate.setTargetClassname(targetClassname);
return aggregate;
}
示例3: loadSample
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private Sample loadSample(String sampleId) {
Sample sample = null;
try {
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName("gov.nih.nci.cananolab.domain.particle.Sample");
CQLQuery query = new CQLQuery();
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(sampleId);
target.setAttribute(attribute);
query.setTarget(target);
CQLQueryResults results;
results = gridClient.query(query);
results.setTargetClassname("gov.nih.nci.cananolab.domain.particle.Sample");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
sample = (Sample) obj;
logger.info("loaded sample info for " + sampleId);
}
} catch (Exception e) {
logger.error("Error loading sample info for " + sampleId);
}
return sample;
}
示例4: createAttributeResults
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
/**
* Creates a CQL Query Results instance containing attribute results
*
* @param attribArrays
* A List of String[], which are the values of the attributes.
* These values must correspond both in number and in order of the
* attribute names
* @param targetClassname
* The name of the class targeted
* @param attribNames
* The names of the attributes queried for
* @return
* A CQLQueryResults instance with its attribute results populated
*/
public static CQLQueryResults createAttributeResults(List attribArrays, String targetClassname, String[] attribNames) {
CQLQueryResults results = new CQLQueryResults();
results.setTargetClassname(targetClassname);
List<CQLAttributeResult> attribResults = new ArrayList<CQLAttributeResult>();
for (Iterator iter = attribArrays.iterator(); iter.hasNext();) {
TargetAttribute[] attribs = new TargetAttribute[attribNames.length];
Object valueArray = iter.next();
String[] attribValues = new String[attribNames.length];
if (valueArray == null) {
Arrays.fill(attribValues, null);
} else if (valueArray.getClass().isArray()) {
for (int j = 0; j < Array.getLength(valueArray); j++) {
Object singleValue = Array.get(valueArray, j);
attribValues[j] = singleValue == null ? null : singleValue.toString();
}
} else {
attribValues = new String[] {valueArray == null ? null : valueArray.toString()};
}
for (int j = 0; j < attribNames.length; j++) {
attribs[j] = new TargetAttribute(attribNames[j], attribValues[j]);
}
attribResults.add(new CQLAttributeResult(attribs));
}
CQLAttributeResult[] attribResultArray = new CQLAttributeResult[attribResults.size()];
attribResults.toArray(attribResultArray);
results.setAttributeResult(attribResultArray);
return results;
}
示例5: loadOrganizationForPointOfContact
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
/** retrieve Organization associated with PointOfContact */
private void loadOrganizationForPointOfContact(PointOfContact poc)
throws RemoteException {
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.Organization");
Association association = new Association();
association
.setName("gov.nih.nci.cananolab.domain.common.PointOfContact");
association.setRoleName("pointOfContactCollection");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(poc.getId().toString());
association.setAttribute(attribute);
target.setAssociation(association);
query.setTarget(target);
CQLQueryResults results = gridClient.query(query);
results.setTargetClassname("gov.nih.nci.cananolab.domain.common.Organization");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
Organization org = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
org = (Organization) obj;
if (org != null) {
poc.setOrganization(org);
}
}
}
示例6: testSampleComposition
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
public void testSampleComposition(String id) {
// "6160390"
System.out.println("Testing SampleComposition with id=" + id);
builder.append("Testing SampleComposition with id=" + id + "\n");
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.particle.SampleComposition");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(id);
target.setAttribute(attribute);
query.setTarget(target);
try {
CQLQueryResults results = gridClient.query(query);
results
.setTargetClassname("gov.nih.nci.cananolab.domain.particle.SampleComposition");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
SampleComposition sc = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
sc = (SampleComposition) obj;
System.out.println("SampleComposition : id=" + sc.getId());
builder.append("SampleComposition : id=" + sc.getId());
}
} catch (Exception e) {
System.out.println("Exception getting SampleComposition for id="
+ id + ": " + e);
builder.append("Exception getting SampleComposition for id="
+ id + ": " + e + "\n");
}
}
示例7: testProtocol
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
public void testProtocol(String id) {
System.out.println("Test Protocol with id=" + id);
builder.append("Test Protocol with id=" + id + "\n");
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.Protocol");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(id);
target.setAttribute(attribute);
query.setTarget(target);
try {
CQLQueryResults results = gridClient.query(query);
results
.setTargetClassname("gov.nih.nci.cananolab.domain.common.Protocol");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
Protocol p = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
p = (Protocol) obj;
System.out.println("Protocol: id=" + p.getId() + "\tName="
+ p.getName() + "\tAbbreviation=" + p.getAbbreviation()
+ "\tType=" + p.getType() + "\tVersion="
+ p.getVersion());
builder.append("Protocol: id=" + p.getId() + "\tName="
+ p.getName() + "\tAbbreviation=" + p.getAbbreviation()
+ "\tType=" + p.getType() + "\tVersion="
+ p.getVersion() + "\n");
// add function for get protocol file by protocol id
testGetFileByProtocolId(p.getId().toString());
}
} catch (Exception e) {
System.out.println("Exception getting Protocol for id=" + id + ": "
+ e);
builder.append("Exception getting Protocol for id=" + id + ": "
+ e + "\n");
}
}
示例8: testGetAllProtocolsByCQLQuery
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
public void testGetAllProtocolsByCQLQuery() {
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.Protocol");
query.setTarget(target);
try {
CQLQueryResults results = gridClient.query(query);
results
.setTargetClassname("gov.nih.nci.cananolab.domain.common.Protocol");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
Protocol p = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
p = (Protocol) obj;
System.out.println("Protocol: id=" + p.getId() + "\tName="
+ p.getName() + "\tAbbreviation=" + p.getAbbreviation()
+ "\tType=" + p.getType() + "\tVersion="
+ p.getVersion());
builder.append("Protocol: id=" + p.getId() + "\tName="
+ p.getName() + "\tAbbreviation=" + p.getAbbreviation()
+ "\tType=" + p.getType() + "\tVersion="
+ p.getVersion() + "\n");
// add function for get protocol file by protocol id
testGetFileByProtocolId(p.getId().toString());
}
} catch (Exception e) {
System.out.println("Exception getting all protocols: " + e);
builder.append("Exception getting all protocols: " + e + "\n");
}
}
示例9: testActivationMethod
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
public void testActivationMethod(String id) {
// "3833872"
System.out.println("Testing ActivationMethod with id=" + id);
builder.append("Testing ActivationMethod with id=" + id + "\n");
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.particle.ActivationMethod");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(id);
target.setAttribute(attribute);
query.setTarget(target);
try {
CQLQueryResults results = gridClient.query(query);
results
.setTargetClassname("gov.nih.nci.cananolab.domain.particle.ActivationMethod");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
ActivationMethod am = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
am = (ActivationMethod) obj;
System.out.println("Activation Effect: id=" + am.getId()
+ "\tActivationEffect=" + am.getActivationEffect()
+ ", Type=" + am.getType());
builder.append("Activation Effect: id=" + am.getId()
+ "\tActivationEffect=" + am.getActivationEffect()
+ ", Type=" + am.getType() + "\n");
}
} catch (Exception e) {
System.out.println("Exception getting ActivationMethod for id="
+ id + ": " + e);
builder.append("Exception getting ActivationMethod for id="
+ id + ": " + e + "\n");
}
}
示例10: testFunctionalizingEntity
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
public void testFunctionalizingEntity(String id) {
// "6225945"
System.out.println("Testing FunctionalizingEntity with id=" + id);
builder.append("Testing FunctionalizingEntity with id=" + id + "\n");
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.particle.FunctionalizingEntity");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(id);
target.setAttribute(attribute);
query.setTarget(target);
try {
CQLQueryResults results = gridClient.query(query);
results
.setTargetClassname("gov.nih.nci.cananolab.domain.particle.FunctionalizingEntity");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
FunctionalizingEntity fe = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
fe = (FunctionalizingEntity) obj;
System.out.println("FunctionalizingEntity: name="
+ fe.getName() + "\tId=" + fe.getId());
builder.append("FunctionalizingEntity: name="
+ fe.getName() + "\tId=" + fe.getId() + "\n");
}
} catch (Exception e) {
System.out
.println("Exception getting FunctionalizaingEntity for id="
+ id + ": " + e);
builder.append("Exception getting FunctionalizaingEntity for id="
+ id + ": " + e + "\n");
}
}
示例11: loadFunctionalizingEntitiesForComposition
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private void loadFunctionalizingEntitiesForComposition(
SampleComposition composition, String[] funcEntityClassNames) {
try {
if (funcEntityClassNames != null) {
for (String name : funcEntityClassNames) {
String fullClassName = null;
if (ClassUtils.getFullClass(name) != null) {
fullClassName = ClassUtils.getFullClass(name)
.getCanonicalName();
} else {
fullClassName = ClassUtils.getFullClass(
OtherFunctionalizingEntity.class
.getCanonicalName()).getCanonicalName();
}
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(fullClassName);
Association association = new Association();
association
.setName("gov.nih.nci.cananolab.domain.particle.SampleComposition");
association.setRoleName("sampleComposition");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(composition.getId().toString());
association.setAttribute(attribute);
target.setAssociation(association);
query.setTarget(target);
CQLQueryResults results = gridClient.query(query);
results.setTargetClassname(fullClassName);
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(
results);
FunctionalizingEntity funcEntity = null;
composition
.setFunctionalizingEntityCollection(new HashSet<FunctionalizingEntity>());
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
funcEntity = (FunctionalizingEntity) obj;
System.out.println("FunctionalizingEntity id="
+ funcEntity.getId() + "\tName="
+ funcEntity.getName() + "\tDesc="
+ funcEntity.getDescription()
+ "\tMolecularFormula="
+ funcEntity.getMolecularFormula()
+ "\tPubChemDataSourceName="
+ funcEntity.getPubChemDataSourceName()
+ "\tMolecularFormulaType="
+ funcEntity.getMolecularFormulaType()
+ "\tValueUnit=" + funcEntity.getValueUnit());
builder.append("FunctionalizingEntity id="
+ funcEntity.getId() + "\tName="
+ funcEntity.getName() + "\tDesc="
+ funcEntity.getDescription()
+ "\tMolecularFormula="
+ funcEntity.getMolecularFormula()
+ "\tPubChemDataSourceName="
+ funcEntity.getPubChemDataSourceName()
+ "\tMolecularFormulaType="
+ funcEntity.getMolecularFormulaType()
+ "\tValueUnit=" + funcEntity.getValueUnit() + "\n");
loadFunctionalizingEntityAssociations(funcEntity);
composition.getFunctionalizingEntityCollection().add(
funcEntity);
}
}
}
} catch (Exception e) {
System.out
.println("Exception getting FunctionalizingEntity for Composition for id="
+ composition.getId() + ": " + e);
builder.append("Exception getting FunctionalizingEntity for Composition for id="
+ composition.getId() + ": " + e + "\n");
}
}
示例12: loadTechniqueForConfig
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private void loadTechniqueForConfig(ExperimentConfig config) {
System.out.println("getting Technique for Config id=" + config.getId());
builder.append("getting Technique for Config id=" + config.getId() + "\n");
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.Technique");
Association association = new Association();
association
.setName("gov.nih.nci.cananolab.domain.common.ExperimentConfig");
association.setRoleName("experimentConfigCollection");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(config.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.Technique");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
Technique technique = null;
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
technique = (Technique) obj;
if (technique != null) {
System.out.println("Technique id=" + technique.getId()
+ "\tAbbreviation=" + technique.getAbbreviation()
+ "\tType=" + technique.getType());
builder.append("Technique id=" + technique.getId()
+ "\tAbbreviation=" + technique.getAbbreviation()
+ "\tType=" + technique.getType() + "\n");
}
}
config.setTechnique(technique);
} catch (Exception e) {
System.out
.println("Exception getting Technique for ExperimentConfig id="
+ config.getId() + ": " + e);
builder.append("Exception getting Technique for ExperimentConfig id="
+ config.getId() + ": " + e + "\n");
}
}
示例13: loadChemicalAssociationsForComposition
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private void loadChemicalAssociationsForComposition(
SampleComposition composition, String[] assocClassNames) {
try {
if (assocClassNames != null) {
for (String name : assocClassNames) {
String fullClassName = null;
if (ClassUtils.getFullClass(name) != null) {
fullClassName = ClassUtils.getFullClass(name)
.getCanonicalName();
} else {
fullClassName = ClassUtils.getFullClass(
OtherChemicalAssociation.class
.getCanonicalName()).getCanonicalName();
}
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(fullClassName);
Association association = new Association();
association
.setName("gov.nih.nci.cananolab.domain.particle.SampleComposition");
association.setRoleName("sampleComposition");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(composition.getId().toString());
association.setAttribute(attribute);
target.setAssociation(association);
query.setTarget(target);
CQLQueryResults results = gridClient.query(query);
results.setTargetClassname(fullClassName);
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(
results);
ChemicalAssociation assoc = null;
composition
.setChemicalAssociationCollection(new HashSet<ChemicalAssociation>());
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
assoc = (ChemicalAssociation) obj;
System.out.println("ChemicalAssociation id="
+ assoc.getId() + "\tDesc="
+ assoc.getDescription());
builder.append("ChemicalAssociation id="
+ assoc.getId() + "\tDesc="
+ assoc.getDescription() + "\n");
loadChemicalAssociationAssociations(assoc);
composition.getChemicalAssociationCollection().add(
assoc);
}
}
}
} catch (Exception e) {
System.out
.println("Exception loading ChemicalAssociation for Composition id="
+ composition.getId() + ": " + e);
builder.append("Exception loading ChemicalAssociation for Composition id="
+ composition.getId() + ": " + e + "\n");
}
}
示例14: loadNanomaterialEntitiesForComposition
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private void loadNanomaterialEntitiesForComposition(
SampleComposition composition, String[] nanoEntityClassNames) {
try {
if (nanoEntityClassNames != null) {
for (String name : nanoEntityClassNames) {
String fullClassName = null;
if (ClassUtils.getFullClass(name) != null) {
fullClassName = ClassUtils.getFullClass(name)
.getCanonicalName();
} else {
fullClassName = ClassUtils.getFullClass(
OtherNanomaterialEntity.class
.getCanonicalName()).getCanonicalName();
}
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(fullClassName);
Association association = new Association();
association
.setName("gov.nih.nci.cananolab.domain.particle.SampleComposition");
association.setRoleName("sampleComposition");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(composition.getId().toString());
association.setAttribute(attribute);
target.setAssociation(association);
query.setTarget(target);
CQLQueryResults results = gridClient.query(query);
results.setTargetClassname(fullClassName);
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(
results);
NanomaterialEntity nanoEntity = null;
composition
.setNanomaterialEntityCollection(new HashSet<NanomaterialEntity>());
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
nanoEntity = (NanomaterialEntity) obj;
if (nanoEntity != null) {
System.out.println("NanomaterialEntity id="
+ nanoEntity.getId() + "\tDesc="
+ nanoEntity.getDescription());
builder.append("NanomaterialEntity id="
+ nanoEntity.getId() + "\tDesc="
+ nanoEntity.getDescription() + "\n");
}
}
}
}
} catch (Exception e) {
System.out.println("Exception getting nanomaterial for composition"
+ ": " + e);
builder.append("Exception getting nanomaterial for composition"
+ ": " + e + "\n");
}
}
示例15: loadDataForFinding
import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; //导入方法依赖的package包/类
private void loadDataForFinding(Finding finding) {
System.out.println("Getting Data for Finding id=" + finding.getId());
builder.append("Getting Data for Finding id=" + finding.getId() + "\n");
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.Datum");
Association association = new Association();
association.setName("gov.nih.nci.cananolab.domain.common.Finding");
association.setRoleName("finding");
Attribute attribute = new Attribute();
attribute.setName("id");
attribute.setPredicate(Predicate.EQUAL_TO);
attribute.setValue(finding.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.Datum");
CQLQueryResultsIterator iter = new CQLQueryResultsIterator(results);
finding.setDatumCollection(new HashSet<Datum>());
while (iter.hasNext()) {
java.lang.Object obj = iter.next();
Datum datum = (Datum) obj;
if (datum != null) {
System.out.println("Datum id=" + datum.getId() + "\tName="
+ datum.getName() + "\tValueType="
+ datum.getValueType() + "\tValueUnit="
+ datum.getValueUnit() + "\tValue="
+ datum.getValue());
builder.append("Datum id=" + datum.getId() + "\tName="
+ datum.getName() + "\tValueType="
+ datum.getValueType() + "\tValueUnit="
+ datum.getValueUnit() + "\tValue="
+ datum.getValue() + "\n");
loadConditionsForDatum(datum);
finding.getDatumCollection().add(datum);
}
}
} catch (Exception e) {
System.out.println("Exception getting Data for Finding id="
+ finding.getId() + ": " + e);
builder.append("Exception getting Data for Finding id="
+ finding.getId() + ": " + e + "\n");
}
}