This commit is contained in:
Redkale
2016-11-25 17:06:03 +08:00
parent 9bc60c1c47
commit 9d85a4dcaf

View File

@@ -17,13 +17,41 @@ import java.io.Serializable;
*/
public interface DistributeTableStrategy<T> {
/**
* 获取对象的表名
* 查询单个对象时调用本方法获取表名
*
* @param table 模板表的表名
* @param primary 记录主键
*
* @return
*/
default String getTable(String table, Serializable primary) {
return null;
}
/**
* 获取对象的表名
* 查询、修改、删除对象时调用本方法获取表名
* 注意: 需保证FilterNode过滤的结果集合必须在一个数据库表中
*
* @param table 模板表的表名
* @param node 过滤条件
*
* @return
*/
default String getTable(String table, FilterNode node) {
return null;
}
/**
* 获取对象的表名
* 新增对象或更新单个对象时调用本方法获取表名
*
* @param table 模板表的表名
* @param bean 实体对象
*
* @return
*/
public String getTable(String table, T bean);
}