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

org.yx.db.sql.DBNameResolvers Maven / Gradle / Ivy

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