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

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

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

Query.getEffectiveOrderBy介绍

[英]Gets the effective ORDER BY clause of this Query, such as may be used to create SQL.
[中]获取此查询的有效ORDER BY子句,例如可用于创建SQL。

代码示例

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

/**
 * Return a List containing clones of the given Query, but with all permutations
 * of order by for the QueryClass objects on the from list.
 *
 * @param q the Query
 * @return clones of the Query with all permutations of orderBy
 */
private static List<Query> getOrderedQueries(Query q) {
  List<Query> queryList = new ArrayList<Query>();
  Set<int[]> permutations = permutations(q.getEffectiveOrderBy().size());
  for (int[] order : permutations) {
    Query newQuery = QueryCloner.cloneQuery(q);
    List<Object> orderBy = new ArrayList<Object>(newQuery.getEffectiveOrderBy());
    newQuery.clearOrderBy();
    for (int i = 0; i < order.length; i++) {
      newQuery.addToOrderBy((QueryClass) orderBy.get(order[i]));
    }
    queryList.add(newQuery);
  }
  return queryList;
}

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

/**
 * Return a List containing clones of the given Query, but with all permutations
 * of order by for the QueryClass objects on the from list.
 *
 * @param q the Query
 * @return clones of the Query with all permutations of orderBy
 */
private static List<Query> getOrderedQueries(Query q) {
  List<Query> queryList = new ArrayList<Query>();
  Set<int[]> permutations = permutations(q.getEffectiveOrderBy().size());
  for (int[] order : permutations) {
    Query newQuery = QueryCloner.cloneQuery(q);
    List<Object> orderBy = new ArrayList<Object>(newQuery.getEffectiveOrderBy());
    newQuery.clearOrderBy();
    for (int i = 0; i < order.length; i++) {
      newQuery.addToOrderBy((QueryClass) orderBy.get(order[i]));
    }
    queryList.add(newQuery);
  }
  return queryList;
}

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

firstOrderByO = (QueryOrderable) q.getEffectiveOrderBy().iterator().next();
if ((firstOrderByO instanceof QueryClass) && (!InterMineObject.class
      .isAssignableFrom(((QueryClass) firstOrderByO).getType()))) {
        || (start - cacheEntry.getLastOffset() >= 10000)) {
      QueryNode firstOrderBy = null;
      firstOrderBy = (QueryNode) q.getEffectiveOrderBy().iterator().next();
      if (firstOrderBy instanceof QueryFunction) {
        return;

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

firstOrderByO = (QueryOrderable) q.getEffectiveOrderBy().iterator().next();
if ((firstOrderByO instanceof QueryClass) && (!InterMineObject.class
      .isAssignableFrom(((QueryClass) firstOrderByO).getType()))) {
        || (start - cacheEntry.getLastOffset() >= 10000)) {
      QueryNode firstOrderBy = null;
      firstOrderBy = (QueryNode) q.getEffectiveOrderBy().iterator().next();
      if (firstOrderBy instanceof QueryFunction) {
        return;

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

HashSet<String> seen = new HashSet<String>();
boolean needComma = false;
for (Object node : q.getEffectiveOrderBy()) {
  boolean desc = false;
  if (node instanceof OrderDescending) {

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

HashSet<String> seen = new HashSet<String>();
boolean needComma = false;
for (Object node : q.getEffectiveOrderBy()) {
  boolean desc = false;
  if (node instanceof OrderDescending) {

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

Object firstOrderByObject = q.getEffectiveOrderBy().iterator().next();
if ((firstOrderByObject instanceof QueryOrderable)
    && (!(firstOrderByObject instanceof QueryObjectReference))) {

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

Object firstOrderByObject = q.getEffectiveOrderBy().iterator().next();
if ((firstOrderByObject instanceof QueryOrderable)
    && (!(firstOrderByObject instanceof QueryObjectReference))) {

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

public void testGetOrderBy() {
  Query q = new Query();
  QueryClass qc1 = new QueryClass(Employee.class);
  QueryClass qc2 = new QueryClass(Department.class);
  QueryField qf1 = new QueryField(qc1, "name");
  QueryField qf2 = new QueryField(qc1, "age");
  QueryField qf3 = new QueryField(qc2, "id");
  QueryField qf4 = new QueryField(qc2, "name");
  q.addFrom(qc1);
  q.addFrom(qc2);
  q.addToOrderBy(qf1);
  q.addToSelect(qc1);
  q.addToSelect(qf2);
  q.addToSelect(qf3);
  q.addToSelect(qc2);
  q.addToSelect(qf4);
  List expected = new ArrayList();
  expected.add(qf1);
  expected.add(qc1);
  expected.add(qf3);
  assertEquals(expected, q.getEffectiveOrderBy());
}

相关文章