本文整理了Java中org.intermine.objectstore.query.Query.getGroupBy
方法的一些代码示例,展示了Query.getGroupBy
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getGroupBy
方法的具体详情如下:
包路径:org.intermine.objectstore.query.Query
类名称:Query
方法名:getGroupBy
[英]Gets the GROUP BY clause of this Query
[中]获取此查询的GROUP BY子句
代码示例来源:origin: org.intermine/intermine-objectstore
/**
* Builds a String representing the GROUP BY component of the Sql query.
*
* @param q the Query
* @param schema the DatabaseSchema in which to look up metadata
* @param state a State object
* @return a String
* @throws ObjectStoreException if something goes wrong
*/
protected static String buildGroupBy(Query q, DatabaseSchema schema,
State state) throws ObjectStoreException {
StringBuffer retval = new StringBuffer();
boolean needComma = false;
for (QueryNode node : q.getGroupBy()) {
retval.append(needComma ? ", " : " GROUP BY ");
needComma = true;
if (node instanceof QueryClass) {
queryClassToString(retval, (QueryClass) node, q, schema, NO_ALIASES_ALL_FIELDS,
state);
} else {
queryEvaluableToString(retval, (QueryEvaluable) node, q, state);
}
}
return retval.toString();
}
代码示例来源:origin: intermine/intermine
/**
* Builds a String representing the GROUP BY component of the Sql query.
*
* @param q the Query
* @param schema the DatabaseSchema in which to look up metadata
* @param state a State object
* @return a String
* @throws ObjectStoreException if something goes wrong
*/
protected static String buildGroupBy(Query q, DatabaseSchema schema,
State state) throws ObjectStoreException {
StringBuffer retval = new StringBuffer();
boolean needComma = false;
for (QueryNode node : q.getGroupBy()) {
retval.append(needComma ? ", " : " GROUP BY ");
needComma = true;
if (node instanceof QueryClass) {
queryClassToString(retval, (QueryClass) node, q, schema, NO_ALIASES_ALL_FIELDS,
state);
} else {
queryEvaluableToString(retval, (QueryEvaluable) node, q, state);
}
}
return retval.toString();
}
代码示例来源:origin: org.intermine/intermine-objectstore
for (QueryNode qn : q.getGroupBy()) {
retval.append(needComma ? ", " : " GROUP BY ");
needComma = true;
代码示例来源:origin: intermine/intermine
for (QueryNode qn : q.getGroupBy()) {
retval.append(needComma ? ", " : " GROUP BY ");
needComma = true;
代码示例来源:origin: intermine/intermine
if ((kind == QUERY_NORMAL) || (kind == QUERY_FOR_PRECOMP) || (kind == QUERY_FOR_GOFASTER)) {
boolean haveOrderBy = true;
if (q.getGroupBy().isEmpty()) {
for (QuerySelectable selectable : q.getSelect()) {
if (selectable instanceof QueryFunction) {
代码示例来源:origin: org.intermine/intermine-objectstore
boolean needWhereComma = state.getWhereBuffer().length() > 0;
boolean needHavingComma = state.getHavingBuffer().length() > 0;
boolean usingHaving = !q.getGroupBy().isEmpty();
constraints.add(c);
while (!constraints.isEmpty()) {
代码示例来源:origin: intermine/intermine
boolean needWhereComma = state.getWhereBuffer().length() > 0;
boolean needHavingComma = state.getHavingBuffer().length() > 0;
boolean usingHaving = !q.getGroupBy().isEmpty();
constraints.add(c);
while (!constraints.isEmpty()) {
代码示例来源:origin: org.intermine/intermine-objectstore
if ((kind == QUERY_NORMAL) || (kind == QUERY_FOR_PRECOMP) || (kind == QUERY_FOR_GOFASTER)) {
boolean haveOrderBy = true;
if (q.getGroupBy().isEmpty()) {
for (QuerySelectable selectable : q.getSelect()) {
if (selectable instanceof QueryFunction) {
代码示例来源:origin: intermine/intermine
Set<Integer> bag = collections.keySet();
if ((q.getConstraint() == null) && q.getOrderBy().isEmpty()
&& q.getGroupBy().isEmpty()) {
代码示例来源:origin: org.intermine/intermine-objectstore
Set<Integer> bag = collections.keySet();
if ((q.getConstraint() == null) && q.getOrderBy().isEmpty()
&& q.getGroupBy().isEmpty()) {
代码示例来源:origin: org.intermine/intermine-objectstore
newQuery.addToOrderBy(newOrder);
for (QueryNode origGroup : query.getGroupBy()) {
QueryNode newGroup = (QueryNode) cloneThing(origGroup, fromElementMap, qopeMap);
newQuery.addToGroupBy(newGroup);
代码示例来源:origin: intermine/intermine
newQuery.addToOrderBy(newOrder);
for (QueryNode origGroup : query.getGroupBy()) {
QueryNode newGroup = (QueryNode) cloneThing(origGroup, fromElementMap, qopeMap);
newQuery.addToGroupBy(newGroup);
代码示例来源:origin: intermine/intermine
return new boolean[] {true, q.getGroupBy().contains(o)
|| q.getGroupBy().contains(((QueryField) o).getFromElement())};
} else if (o instanceof QueryClass) {
return new boolean[] {true, q.getGroupBy().contains(o)};
} else if (o instanceof QueryValue) {
return new boolean[] {true, true};
return new boolean[] {true, q.getGroupBy().contains(o)
|| q.getGroupBy().contains(((QueryForeignKey) o).getQueryClass())};
} else if (o instanceof QueryReference) {
QueryClass qc = ((QueryReference) o).getQueryClass();
代码示例来源:origin: org.intermine/intermine-objectstore
return new boolean[] {true, q.getGroupBy().contains(o)
|| q.getGroupBy().contains(((QueryField) o).getFromElement())};
} else if (o instanceof QueryClass) {
return new boolean[] {true, q.getGroupBy().contains(o)};
} else if (o instanceof QueryValue) {
return new boolean[] {true, true};
return new boolean[] {true, q.getGroupBy().contains(o)
|| q.getGroupBy().contains(((QueryForeignKey) o).getQueryClass())};
} else if (o instanceof QueryReference) {
QueryClass qc = ((QueryReference) o).getQueryClass();
代码示例来源:origin: org.intermine/intermine-integrate
if (query.getOrderBy().size() > 0 || query.getGroupBy().size() > 0) {
throw new ObjectStoreException("Query cannot be translated: " + query);
代码示例来源:origin: intermine/intermine
if (query.getOrderBy().size() > 0 || query.getGroupBy().size() > 0) {
throw new ObjectStoreException("Query cannot be translated: " + query);
内容来源于网络,如有侵权,请联系作者删除!