We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.5.7
问题. queryWapper里.没有读取TableField的typeHandler去做条件转换.
实体类 Class MyObj{ @TableField(typeHandler = EnumOrdinalTypeHandler.class) private ResourceEnum resourceType; }
查询条件 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(MyObj::getResourceType, ResourceEnum.cup); queryWrapper.last(" limit 1"); System.out.println(myobjMapper.selectList(queryWrapper));
不使用全局配置.
==> Preparing: SELECT id,resource_type FROM MyObj WHERE (resource_type = ?) limit 1 ==> Parameters: cup(String) <== Columns: resource_type <== Row: 0 <== Total: 1
使用全局配置 ==> Preparing: SELECT resource_type FROM MyObj WHERE (resource_type = ?) limit 1 Parameters: 2(Integer) Total: 1 所以我想问一下 对于项目里有人用Ordinal.有人用string的. 应该怎么办?
No response
The text was updated successfully, but these errors were encountered:
你看过文档里的通用枚举处理器吗? 你一个团队都不能统一枚举的吗?
Sorry, something went wrong.
看过.注册一个补充的,最后通过补充的设置么.. 不能呀.小公司,大家是不同的业务.谁也干涉不了谁呀.
一个项目里代码都不能统一,什么垃圾公司, 要么你.eq(MyObj::getResourceType, ResourceEnum.cup.value()) 要么参考文档设置默认枚举处理器自己去处理
.eq(MyObj::getResourceType, ResourceEnum.cup.value())
小公司么.那我再问一下 @TableField(typeHandler = EnumOrdinalTypeHandler.class) 这个typeHandler是不是只能处理从resultset转java对象的时候呀.别的时候.就只能自己去注册全局转换?
注解等于注入的crud的xml语法里手写进行指定typehandler
No branches or pull requests
确认
当前程序版本
3.5.7
问题描述
问题.
queryWapper里.没有读取TableField的typeHandler去做条件转换.
实体类
Class MyObj{
@TableField(typeHandler = EnumOrdinalTypeHandler.class)
private ResourceEnum resourceType;
}
查询条件
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(MyObj::getResourceType, ResourceEnum.cup);
queryWrapper.last(" limit 1");
System.out.println(myobjMapper.selectList(queryWrapper));
不使用全局配置.
==> Preparing: SELECT id,resource_type FROM MyObj WHERE (resource_type = ?) limit 1
==> Parameters: cup(String)
<== Columns: resource_type
<== Row: 0
<== Total: 1
使用全局配置
==> Preparing: SELECT resource_type FROM MyObj WHERE (resource_type = ?) limit 1
Parameters: 2(Integer)
Total: 1
所以我想问一下
对于项目里有人用Ordinal.有人用string的.
应该怎么办?
详细堆栈日志
No response
The text was updated successfully, but these errors were encountered: