/** * Return true if the select with the given parameters needs a * subselect to apply a range. */ private boolean requiresSubselectForRange(long start, long end, boolean distinct, SQLBuffer order) { if (start == 0 && end == Long.MAX_VALUE) return false; return start != 0 || distinct || (order != null && !order.isEmpty()); }
protected boolean isUsingOrderBy(SQLBuffer sql) { return sql != null && !sql.isEmpty(); }
@Override public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, long start, long end, String forUpdateClause) { // hsql requires ordering when limit is used if ((start != 0 || end != Long.MAX_VALUE) && (order == null || order.isEmpty())) order = _oneBuffer; return super.toOperation(op, selects, from, where, group, having, order, distinct, start, end, forUpdateClause); }
@Override public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, long start, long end, String forUpdateClause) { // hsql requires ordering when limit is used if ((start != 0 || end != Long.MAX_VALUE) && (order == null || order.isEmpty())) order = _oneBuffer; return super.toOperation(op, selects, from, where, group, having, order, distinct, start, end, forUpdateClause); }
@Override public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, long start, long end, String forUpdateClause) { // hsql requires ordering when limit is used if ((start != 0 || end != Long.MAX_VALUE) && (order == null || order.isEmpty())) order = _oneBuffer; return super.toOperation(op, selects, from, where, group, having, order, distinct, start, end, forUpdateClause); }
@Override public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, long start, long end, String forUpdateClause) { // hsql requires ordering when limit is used if ((start != 0 || end != Long.MAX_VALUE) && (order == null || order.isEmpty())) order = _oneBuffer; return super.toOperation(op, selects, from, where, group, having, order, distinct, start, end, forUpdateClause); }
public SQLBuffer toOperation(String op, SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer group, SQLBuffer having, SQLBuffer order, boolean distinct, long start, long end, String forUpdateClause) { // hsql requires ordering when limit is used if ((start != 0 || end != Long.MAX_VALUE) && (order == null || order.isEmpty())) order = _oneBuffer; return super.toOperation(op, selects, from, where, group, having, order, distinct, start, end, forUpdateClause); }
/** * Add the given condition to the HAVING clause. */ private void having(SQLBuffer sql, PathJoins pj) { // no need to use joins... if (sql == null || sql.isEmpty()) return; if (_having == null) _having = new SQLBuffer(_dict); else if (!_having.isEmpty()) _having.append(" AND "); _having.append(sql); }
/** * Add the given condition to the HAVING clause. */ private void having(SQLBuffer sql, PathJoins pj) { // no need to use joins... if (sql == null || sql.isEmpty()) return; if (_having == null) _having = new SQLBuffer(_dict); else if (!_having.isEmpty()) _having.append(" AND "); _having.append(sql); }
/** * Add the given condition to the HAVING clause. */ private void having(SQLBuffer sql, PathJoins pj) { // no need to use joins... if (sql == null || sql.isEmpty()) return; if (_having == null) _having = new SQLBuffer(_dict); else if (!_having.isEmpty()) _having.append(" AND "); _having.append(sql); }
/** * Add the given condition to the HAVING clause. */ private void having(SQLBuffer sql, PathJoins pj) { // no need to use joins... if (sql == null || sql.isEmpty()) return; if (_having == null) _having = new SQLBuffer(_dict); else if (!_having.isEmpty()) _having.append(" AND "); _having.append(sql); }
/** * Add the given condition to the WHERE clause. */ private void where(String sql, PathJoins pj) { // no need to use joins... if (StringUtils.isEmpty(sql)) return; if (_where == null) _where = new SQLBuffer(_dict); else if (!_where.isEmpty()) _where.append(" AND "); _where.append(sql); }
/** * Add the given condition to the WHERE clause. */ private void where(String sql, PathJoins pj) { // no need to use joins... if (StringUtils.isEmpty(sql)) return; if (_where == null) _where = new SQLBuffer(_dict); else if (!_where.isEmpty()) _where.append(" AND "); _where.append(sql); }
/** * Add the given condition to the HAVING clause. */ private void having(String sql, PathJoins pj) { // no need to use joins... if (StringUtils.isEmpty(sql)) return; if (_having == null) _having = new SQLBuffer(_dict); else if (!_having.isEmpty()) _having.append(" AND "); _having.append(sql); }
/** * Add the given condition to the HAVING clause. */ private void having(String sql, PathJoins pj) { // no need to use joins... if (StringUtils.isEmpty(sql)) return; if (_having == null) _having = new SQLBuffer(_dict); else if (!_having.isEmpty()) _having.append(" AND "); _having.append(sql); }
/** * Add the given condition to the WHERE clause. */ private void where(String sql, PathJoins pj) { // no need to use joins... if (StringUtil.isEmpty(sql)) return; if (_where == null) _where = new SQLBuffer(_dict); else if (!_where.isEmpty()) _where.append(" AND "); _where.append(sql); }