-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[错误报告]: mybatis-plus 3.5.7-3.5.10.1版本 pgsql 主键是UUID 执行removeByIds removeBatchByIds方法时报错 #6677
Comments
另外 我的实体类主键是UUID
} org.mybatis.spring.MyBatisSystemException: Error updating database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.util.UUID'The error may exist in system/mapper/SysUserTokenMapper.java (best guess)The error may involve system.mapper.SysUserTokenMapper.deleteByIds-InlineThe error occurred while setting parametersSQL: UPDATE sys_user_token SET updated_at=?,updated_by=?, is_deleted=true WHERE id IN ( ? ) AND is_deleted=falseCause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.util.UUID'
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.util.UUID' |
mybatis没有UUID的对应typehandler |
嗯 感觉您的回复,但是我们自己实现了一个UUIDTypeHandler 现在的代码在mybatis 3.5.6 可以正常执行 但是之后的版本就报上述的错误 import org.apache.ibatis.type.BaseTypeHandler; import java.sql.CallableStatement; @MappedTypes(UUID.class)
} |
后面的版本支持了在逻辑删除下能自动填充字段 |
确认
当前程序版本
3.5.7-3.5.10.1
问题描述
执行环境 spring boot 3.3.7 版本 pgsql16.3 主键是UUID 执行removeByIds removeBatchByIds方法时报错
之前的mybatis 3.5.6 执行正常而升级之后的3.5.7-3.5.10.1 执行相关方法报错
List ids = List.of(UUID.fromString("688aa547-09f8-4a26-8c71-411d4ba7d67e"));
boolean flag = sysUserTokenService.removeByIds(List.of(ids));
org.mybatis.spring.MyBatisSystemException:
Error updating database. Cause: java.lang.UnsupportedOperationException
The error may exist in system/mapper/SysUserTokenMapper.java (best guess)
The error may involve system.mapper.SysUserTokenMapper.deleteByIds
The error occurred while executing an update
Cause: java.lang.UnsupportedOperationException
详细堆栈日志
The text was updated successfully, but these errors were encountered: