HQL枚举类查询
HQL枚举类查询踩坑记录
问题描述
在开发一个SSH老项目的过程中,写HQL遇到了类型转换错误:
Integer can't cast to Enum
HQL语句如下:
select pr.agencyName from Project pr where pr.type = :type and pr.status >= :status
参数Map:
map.put("type",1);
map.put("status",3);
Project实体类中type和status均为枚举类型,数据库中对应i
原创
2021-07-09 11:13:48 ·
350 阅读 ·
0 评论