After migratingto Hibernate 6.2.6.Final I started seeing test case failure with below message
ClassCast class java.lang.String cannot be cast to class java.lang.Character (java.lang.String and java.lang.Character are in module java.base of loader ‘bootstrap’)
@Column(name = "document_type", columnDefinition = "char(1)", length = 1)
@Enumerated(EnumType.STRING)
private DocumentTypeEnum documentType;
public enum DocumentTypeEnum {
A,
B,
C
}
In postgress DB
document_type character(1) COLLATE pg_catalog.“default”,
Test case fine with hibernate 5 and but test case fails with latest Hibernate version
With hibernate-5, it will do auto mapping String to CHAR(which is the type of DB column)
But failing with hibernate 6