Several things that have arisen over the course of this migration – so I’ll deal with them as they arise. Some are errors, some are not – but links to things that are useful to record.
org.hibernate.HibernateException: Wrong column type Found: char, expected: varchar2(255)
What happened here, is that as Cedar715 (Jai) points out, on his blogpost that Hibernate tried to map the entity – and did not like the type that it found.
In my specific case.
@Column(nullable = false, length = 1) private String loglevel = "I";
was the one that was not liked.
Here, we are storing the “loglevel” in the database as a single char.
The sqldeveloper snippet of the table is:
The definition was for a single char, however the variable loglevel is a
By default, the Hibernate converts java.lang.String to varchar2(255) – so we have a type mismatch.
Because the persistence.xml has schema validation turned on
<property name="hibernate.hbm2ddl.auto" value="validate"/>
it will throw the error.
Add a column definition – below.
@Column(nullable = false, columnDefinition = "char", length = 1) private String loglevel = "I";