io.ebeaninternal.server.query.DbOrderByTrim Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.query;
import java.util.regex.Pattern;
class DbOrderByTrim {
private static final Pattern orderByTrim = Pattern.compile("(?i)\\b asc\\b|\\b desc\\b");
/**
* Convert the dbOrderBy clause to be safe for adding to select or distinct on.
*/
static String trim(String dbOrderBy) {
// just remove the ASC and DESC keywords
return orderByTrim.matcher(dbOrderBy).replaceAll("");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy