org.intermine.objectstore.query.Query.addToSelect()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.intermine.objectstore.query.Query.addToSelect方法的一些代码示例,展示了Query.addToSelect的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.addToSelect方法的具体详情如下:
包路径:org.intermine.objectstore.query.Query
类名称:Query
方法名:addToSelect

Query.addToSelect介绍

[英]Add a QuerySelectable to the SELECT clause of this Query
[中]

代码示例

代码示例来源:origin: org.intermine/intermine-objectstore

private int countClass(ObjectStore os, Class<? extends FastPathObject> cls)
  throws ObjectStoreException {
  Query q = new Query();
  QueryClass qc = new QueryClass(cls);
  q.addToSelect(qc);
  q.addFrom(qc);
  return os.count(q, ObjectStore.SEQUENCE_IGNORE);
}

代码示例来源:origin: org.intermine/intermine-api

private void buildBag() throws InternalBagOperationException {
  ObjectStoreBagCombination osbc = combineBags();
  Query q = new Query();
  q.addToSelect(osbc);
  LOG.debug(q.toString());
  try {
    combined.addToBagFromQuery(q);
  } catch (ObjectStoreException e) {
    cleanUp();
    throw new InternalBagOperationException("Error constructing bag", e);
  }
}

代码示例来源:origin: intermine/intermine

public static Query dynamicClassInterface() throws Exception {
  Set classes = new HashSet();
  classes.add(Broke.class);
  classes.add(Employable.class);
  QueryClass qc1 = new QueryClass(classes);
  Query q1 = new Query();
  q1.addFrom(qc1);
  q1.addToSelect(qc1);
  return q1;
}

代码示例来源:origin: intermine/intermine

public static Query subclassCollection2() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Department.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  q.addToSelect(new QueryCollectionPathExpression(qc, "employees", Broke.class, Employee.class));
  q.setDistinct(false);
  return q;
}

代码示例来源:origin: org.intermine/intermine-objectstore

private Results getFieldSummary(ClassDescriptor cld, String fieldName, ObjectStore os) {
  Query q = new Query();
  q.setDistinct(true);
  QueryClass qc = new QueryClass(cld.getType());
  q.addToSelect(new QueryField(qc, fieldName));
  q.addFrom(qc);
  Results results = os.execute(q);
  return results;
}

代码示例来源:origin: intermine/intermine

public static Query selectInterfaceAndSubClasses3() throws Exception {
  QueryClass qc1 = new QueryClass(ImportantPerson.class);
  Query q1 = new Query();
  q1.addToSelect(qc1);
  q1.addFrom(qc1);
  return q1;
}

代码示例来源:origin: intermine/intermine

public static Query whereClassClass() throws Exception {
  QueryClass qc1 = new QueryClass(Company.class);
  QueryClass qc2 = new QueryClass(Company.class);
  ClassConstraint cc1 = new ClassConstraint(qc1, ConstraintOp.EQUALS, qc2);
  Query q1 = new Query();
  q1.addFrom(qc1);
  q1.addFrom(qc2);
  q1.addToSelect(qc1);
  q1.addToSelect(qc2);
  q1.setConstraint(cc1);
  return q1;
}

代码示例来源:origin: intermine/intermine

public static Query whereNotClassClass() throws Exception {
  QueryClass qc1 = new QueryClass(Company.class);
  QueryClass qc2 = new QueryClass(Company.class);
  ClassConstraint cc1 = new ClassConstraint(qc1, ConstraintOp.NOT_EQUALS, qc2);
  Query q1 = new Query();
  q1.addFrom(qc1);
  q1.addFrom(qc2);
  q1.addToSelect(qc1);
  q1.addToSelect(qc2);
  q1.setConstraint(cc1);
  return q1;
}

代码示例来源:origin: intermine/intermine

public static Query selectClassFromInterMineObject() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(InterMineObject.class);
  q.addFrom(qc);
  QueryField qf = new QueryField(qc, "class");
  q.addToSelect(qf);
  q.addToSelect(new QueryFunction());
  q.addToGroupBy(qf);
  q.setDistinct(false);
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query queryClassBagNotContainsObject() throws Exception {
  Query q = new Query();
  QueryClassBag qcb = new QueryClassBag(Department.class, Arrays.asList(new Object[]{data.get("DepartmentA1"), data.get("DepartmentB1")}));
  q.addFrom(qcb);
  q.addToSelect(new QueryField(qcb));
  q.setConstraint(new ContainsConstraint(new QueryCollectionReference(qcb, "employees"), ConstraintOp.DOES_NOT_CONTAIN, (Employee) data.get("EmployeeA1")));
  q.setDistinct(false);
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query objectPathExpression3() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Employee.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  QueryObjectPathExpression qope1 = new QueryObjectPathExpression(qc, "department");
  qope1.addToSelect(new QueryObjectPathExpression(qope1.getDefaultClass(), "company"));
  q.addToSelect(qope1);
  q.setDistinct(false);
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query emptyAndConstraintSet() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Company.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  q.setConstraint(new ConstraintSet(ConstraintOp.AND));
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query emptyOrConstraintSet() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Company.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  q.setConstraint(new ConstraintSet(ConstraintOp.OR));
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query orderByReference() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Employee.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  q.addToOrderBy(new QueryObjectReference(qc, "department"));
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query orderDescending() throws Exception {
  Query q = new Query();
  q.setDistinct(false);
  QueryClass qc = new QueryClass(Employee.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  q.addToOrderBy(new OrderDescending(qc));
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query containsConstraintNullCollection1N() throws Exception {
  Query q1 = new Query();
  QueryClass qc = new QueryClass(Department.class);
  q1.addFrom(qc);
  q1.addToSelect(qc);
  ContainsConstraint c = new ContainsConstraint(
      new QueryCollectionReference(qc, "employees"), ConstraintOp.IS_NULL);
  q1.setConstraint(c);
  return q1;
}

代码示例来源:origin: intermine/intermine

public static Query containsConstraintNullCollectionMN() throws Exception {
  Query q1 = new Query();
  QueryClass qc = new QueryClass(Company.class);
  q1.addFrom(qc);
  q1.addToSelect(qc);
  ContainsConstraint c = new ContainsConstraint(
      new QueryCollectionReference(qc, "contractors"), ConstraintOp.IS_NULL);
  q1.setConstraint(c);
  return q1;
}

代码示例来源:origin: intermine/intermine

public static Query selectFunctionNoGroup() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Employee.class);
  q.addFrom(qc);
  q.addToSelect(new QueryFunction(new QueryField(qc, "id"), QueryFunction.MIN));
  q.setDistinct(false);
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query constrainClass1() throws Exception {
  Query q = new Query();
  QueryClass qc1 = new QueryClass(InterMineObject.class);
  q.addFrom(qc1);
  q.addToSelect(qc1);
  QueryField qf = new QueryField(qc1, "class");
  q.setConstraint(new SimpleConstraint(qf, ConstraintOp.EQUALS, new QueryValue(Employee.class)));
  q.setDistinct(false);
  return q;
}

代码示例来源:origin: intermine/intermine

public static Query selectWhereBackslash() throws Exception {
  Query q = new Query();
  QueryClass qc = new QueryClass(Employee.class);
  q.addFrom(qc);
  q.addToSelect(qc);
  q.setConstraint(new SimpleConstraint(new QueryField(qc, "name"), ConstraintOp.EQUALS, new QueryValue("Fred\\Blog's")));
  q.setDistinct(false);
  return q;
}

相关文章