All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebeaninternal.server.query.DbOrderByTrim Maven / Gradle / Ivy

There is a newer version: 15.8.1
Show newest version
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