mirror of
https://github.com/CarmJos/EasySQL.git
synced 2026-07-15 13:41:21 +08:00
[0.3.6] 枚举参数默认采用 name() 方法
This commit is contained in:
@@ -197,6 +197,12 @@ public class StatementUtil {
|
||||
// 其它数字类型按照默认类型传入
|
||||
}
|
||||
|
||||
if (param instanceof Enum) {
|
||||
//枚举类采用 name()
|
||||
preparedStatement.setString(paramIndex, ((Enum<?>) param).name());
|
||||
return;
|
||||
}
|
||||
|
||||
// 其它参数类型直接传入
|
||||
preparedStatement.setObject(paramIndex, param);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user