/** * <p>Renders the ORDER BY portion of the query in the database-specific SQL * dialect. Very few databases deviate from the standard in this matter, * thus the default implementation is usually sufficient.</p> * <p/> * <p>An example return value: <code>" ORDER BY name ASC"</code></p> * <p/> * <p>There is usually no need to call this method directly. Under normal * operations it functions as a delegate for {@link #renderQuery(Query, TableNameConverter, boolean)}.</p> * * @param query The Query instance from which to determine the ORDER BY properties. * @return The database-specific SQL rendering of the ORDER BY portion of the query. */ protected String renderQueryOrderBy(Query query) { StringBuilder sql = new StringBuilder(); String orderClause = query.getOrderClause(); if (orderClause != null) { sql.append(" ORDER BY "); sql.append(processOrderClause(orderClause)); } return sql.toString(); }
/** * <p>Renders the ORDER BY portion of the query in the database-specific SQL * dialect. Very few databases deviate from the standard in this matter, * thus the default implementation is usually sufficient.</p> * <p/> * <p>An example return value: <code>" ORDER BY name ASC"</code></p> * <p/> * <p>There is usually no need to call this method directly. Under normal * operations it functions as a delegate for {@link #renderQuery(Query, TableNameConverter, boolean)}.</p> * * @param query The Query instance from which to determine the ORDER BY properties. * @return The database-specific SQL rendering of the ORDER BY portion of the query. */ protected String renderQueryOrderBy(Query query) { StringBuilder sql = new StringBuilder(); String orderClause = query.getOrderClause(); if (orderClause != null) { sql.append(" ORDER BY "); sql.append(processOrderClause(orderClause)); } return sql.toString(); }