noear / wood

noear::微型ORM框架(支持:java sql,xml sql,annotation sql;事务;缓存;监控;等...)
Apache License 2.0
13 stars 3 forks source link

调用BaseMapper的子类的updateById(T entity, boolean excludeNull)方法报错 #1

Closed dyrnq closed 1 year ago

dyrnq commented 1 year ago

数据库string字段被当成了int字段导致执行报错

pass=$2a$12$1QbLu.i9uvMIgKoGzAg55uu7wSeV0.su.I66A1E6B/EUTdEZopoCO 该值为BCryptPasswordEncoder加密后的值

org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "UPDATE `user` SET `id`=?,`name`=?,`pass`=2[*]aPUBLIC12PUBLIC1QbLu.i9uvMIgKoGzAg55uu7wSeV0.su.I66A1E6B/EUTdEZopoCO WHERE `id` = ? "; SQL statement:
UPDATE `user` SET `id`=?,`name`=?,`pass`=2aPUBLIC12PUBLIC1QbLu.i9uvMIgKoGzAg55uu7wSeV0.su.I66A1E6B/EUTdEZopoCO WHERE `id` = ?  [42000-214]
dyrnq commented 1 year ago

@noear 请教大佬🤪

noear commented 1 year ago

看一下你的代码!

noear commented 1 year ago

程序启动时加行代码:“WoodConfig.isUsingValueExpression=false”

noear commented 1 year ago

"$"号在 wood 里,是特别意思。。。是sql 原生表达式的起始符。通过 “WoodConfig.isUsingValueExpression=false”,默认关掉它