org.yx.db.sql.DBNameResolvers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sumk Show documentation
Show all versions of sumk Show documentation
A quick developing framewort for internet company
package org.yx.db.sql;
import java.util.Objects;
import java.util.function.UnaryOperator;
import org.yx.util.StringUtil;
public class DBNameResolvers {
private static UnaryOperator columnNameResolver = StringUtil::camelToUnderline;
private static UnaryOperator tableNameResolver = columnNameResolver;
private static UnaryOperator cachePrefixResolver = tableName -> "{" + tableName + "}";
public static UnaryOperator getColumnNameResolver() {
return columnNameResolver;
}
public static void setColumnNameResolver(UnaryOperator columnNameResolver) {
DBNameResolvers.columnNameResolver = Objects.requireNonNull(columnNameResolver);
}
public static UnaryOperator getTableNameResolver() {
return tableNameResolver;
}
public static void setTableNameResolver(UnaryOperator tableNameResolver) {
DBNameResolvers.tableNameResolver = Objects.requireNonNull(tableNameResolver);
}
public static UnaryOperator getCachePrefixResolver() {
return cachePrefixResolver;
}
public static void setCachePrefixResolver(UnaryOperator cachePrefixResolver) {
DBNameResolvers.cachePrefixResolver = Objects.requireNonNull(cachePrefixResolver);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy