net.wicp.tams.common.callback.impl.convertvalue.obj.CreateDbCallBackOds Maven / Gradle / Ivy
package net.wicp.tams.common.callback.impl.convertvalue.obj;
import org.apache.commons.lang3.tuple.Pair;
import net.wicp.tams.common.callback.ICreateDbCallBack;
/***
* 数据仓库命名规范,一般用于ods的迁移
*
* @author Andy
*
*/
public abstract class CreateDbCallBackOds implements ICreateDbCallBack {
private final String region;
public CreateDbCallBackOds(String region) {
this.region = region;
}
@Override
public String getDbAndTb(Pair keyObj) {
String dbstr = keyObj.getLeft().toLowerCase();
dbstr = dbstr.replace("-", "_");
String tbstr = keyObj.getRight().toLowerCase();
tbstr = tbstr.replace("-", "_");
return String.format("%s.ods_%s_%s", this.region, dbstr, tbstr);
}
}