ソースを参照

去掉 Dialect.getModelGeneratedKey() 的 Config 参数

James 8 年 前
コミット
b075cedfe8

+ 1 - 1
src/main/java/com/jfinal/plugin/activerecord/Model.java

@@ -434,7 +434,7 @@ public abstract class Model<M extends Model> implements Serializable {
 			}
 			config.dialect.fillStatement(pst, paras);
 			result = pst.executeUpdate();
-			config.dialect.getModelGeneratedKey(this, pst, table, config);
+			config.dialect.getModelGeneratedKey(this, pst, table);
 			getModifyFlag().clear();
 			return result >= 1;
 		} catch (Exception e) {

+ 2 - 2
src/main/java/com/jfinal/plugin/activerecord/dialect/Dialect.java

@@ -79,11 +79,11 @@ public abstract class Dialect {
 	/**
 	 * Get id after save method.
 	 */
-	public void getModelGeneratedKey(Model<?> model, PreparedStatement pst, Table table, Config config) throws SQLException {
+	public void getModelGeneratedKey(Model<?> model, PreparedStatement pst, Table table) throws SQLException {
 		String[] pKeys = table.getPrimaryKey();
 		ResultSet rs = pst.getGeneratedKeys();
 		for (String pKey : pKeys) {
-			if (model.get(pKey) == null || config.getDialect().isOracle()) {
+			if (model.get(pKey) == null || isOracle()) {
 				if (rs.next()) {
 					Class<?> colType = table.getColumnType(pKey);
 					if (colType == Integer.class || colType == int.class) {