Closed
Description
when i bind the parameter on a property of type set
The predicate expected to be generated:
id in sysUser.departments
The actual generated predicate
[id] in sysUser.departments
This problem works fine in hibernate5, but throws an exception in hibernate6
2023-05-24 10:32:17.650 ERROR [http-nio-8083-exec-8] at com.teamytd.config.web.UnknownExceptionNotice.commonException(UnknownExceptionNotice.java:32) - java.lang.ClassCastException: class java.util.LinkedHashSet cannot be cast to class java.lang.String (java.util.LinkedHashSet and java.lang.String are in module java.base of loader 'bootstrap')
at org.hibernate.type.descriptor.java.StringJavaType.unwrap(StringJavaType.java:27)
at org.hibernate.type.descriptor.jdbc.VarcharJdbcType$1.doBind(VarcharJdbcType.java:108)
at org.hibernate.type.descriptor.jdbc.BasicBinder.bind(BasicBinder.java:61)
...
entity:
public class SysUser {
...
private Set<SysDepartment> departments;
...
}
controller argument:
departments: 297e00ad8848850e0188488987d70013