浏览代码

filter(...) 更名为 skip(...)

James 5 年之前
父节点
当前提交
eb1d7799ef
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/main/java/com/jfinal/plugin/activerecord/generator/MetaBuilder.java

+ 6 - 6
src/main/java/com/jfinal/plugin/activerecord/generator/MetaBuilder.java

@@ -44,7 +44,7 @@ public class MetaBuilder {
 	protected Dialect dialect = new MysqlDialect();
 	protected Set<String> excludedTables = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
 	
-	protected Predicate<String> filterPredicate = null;
+	protected Predicate<String> tableSkip = null;
 	
 	protected Connection conn = null;
 	protected DatabaseMetaData dbMeta = null;
@@ -139,14 +139,14 @@ public class MetaBuilder {
 	}
 	
 	/**
-	 * 过不需要生成器处理的 table
+	 * 过不需要生成器处理的 table
 	 * 
 	 * 由于 setMetaBuilder 将置换掉 MetaBuilder,所以 Generator.addExcludedTable(...)
 	 * 需要放在 setMetaBuilder 之后调用,否则 addExcludedTable 将无效
 	 * 
 	 * 示例:
 		Generator gen = new Generator(...);
-		gen.setMetaBuilder(new MetaBuilder(dataSource).filter(
+		gen.setMetaBuilder(new MetaBuilder(dataSource).skip(
 			tableName -> {
 				return tableName.startsWith("SYS_");
 			})
@@ -155,8 +155,8 @@ public class MetaBuilder {
 		gen.generate();
 		
 	 */
-	public MetaBuilder filter(Predicate<String> predicate) {
-		this.filterPredicate = predicate;
+	public MetaBuilder skip(Predicate<String> tableSkip) {
+		this.tableSkip = tableSkip;
 		return this;
 	}
 	
@@ -219,7 +219,7 @@ public class MetaBuilder {
 			}
 			
 			// jfinal 4.3 新增过滤 table 机制
-			if (filterPredicate != null && filterPredicate.test(tableName)) {
+			if (tableSkip != null && tableSkip.test(tableName)) {
 				System.out.println("Skip table :" + tableName);
 				continue ;
 			}