James 7 年 前
コミット
7f982df719

+ 4 - 0
src/main/java/com/jfinal/plugin/activerecord/Db.java

@@ -279,6 +279,10 @@ public class Db {
 		return MAIN.find(sql);
 	}
 	
+	public static List<Record> findAll(String tableName) {
+		return MAIN.findAll(tableName);
+	}
+	
 	/**
 	 * Find first record. I recommend add "limit 1" in your sql.
 	 * @param sql an SQL statement that may contain one or more '?' IN parameter placeholders

+ 5 - 0
src/main/java/com/jfinal/plugin/activerecord/DbPro.java

@@ -356,6 +356,11 @@ public class DbPro {
 		return find(sql, NULL_PARA_ARRAY);
 	}
 	
+	public List<Record> findAll(String tableName) {
+		String sql = config.dialect.forFindAll(tableName);
+		return find(sql, NULL_PARA_ARRAY);
+	}
+	
 	/**
 	 * Find first record. I recommend add "limit 1" in your sql.
 	 * @param sql an SQL statement that may contain one or more '?' IN parameter placeholders