|
|
@@ -457,8 +457,10 @@ public class DbPro {
|
|
|
*/
|
|
|
public boolean delete(String tableName, String primaryKey, Record record) {
|
|
|
String[] pKeys = primaryKey.split(",");
|
|
|
- if (pKeys.length <= 1)
|
|
|
- return deleteById(tableName, primaryKey, record.get(primaryKey));
|
|
|
+ if (pKeys.length <= 1) {
|
|
|
+ Object t = record.get(primaryKey); // 引入中间变量避免 JDK 8 传参类型有误
|
|
|
+ return deleteById(tableName, primaryKey, t);
|
|
|
+ }
|
|
|
|
|
|
config.dialect.trimPrimaryKeys(pKeys);
|
|
|
Object[] idValue = new Object[pKeys.length];
|
|
|
@@ -479,7 +481,8 @@ public class DbPro {
|
|
|
*/
|
|
|
public boolean delete(String tableName, Record record) {
|
|
|
String defaultPrimaryKey = config.dialect.getDefaultPrimaryKey();
|
|
|
- return deleteById(tableName, defaultPrimaryKey, record.get(defaultPrimaryKey));
|
|
|
+ Object t = record.get(defaultPrimaryKey); // 引入中间变量避免 JDK 8 传参类型有误
|
|
|
+ return deleteById(tableName, defaultPrimaryKey, t);
|
|
|
}
|
|
|
|
|
|
/**
|