org.hibernate.HibernateException: Wrong column type...Found: char, expected: varchar2
January 23, 2012 14:58:58 Last update: January 23, 2012 14:58:58
This exception occurs when the Java object attribute is of type String, while the database column is of type CHAR(n), and
There are two solutions:
hibernate.hbm2ddl.auto is validate in persistence.xml.
There are two solutions:
- Add
columnDefinitionto the@Columnannotation:@Column(name = “STATE_CODE”, columnDefinition = “char”)
- Remove
hibernate.hbm2ddl.autofrompersistence.xml.