java - Hibernate Initial SessionFactory creation failed -
I'm trying to use hibernate to fill in my jsf
selectonmenu
The problem is that I got an unsuccessful problem creating the initial sessionfire
before applying my work in the application center, before installing it in session, and I did not get any errors.
For the complete error now
initial session. Java.lang.ClassCastException: org.hibernate.type.StringType can not be inserted in org.hibernate.type.VersionType
You are very likely to have a VARCHAR
column version
column, and hibernate it reverse engineering equipment generates it:
& lt; Version name = "version" type = "string" & gt; & Lt; Column name = "VERSION" length = "20" /> & Lt; / Edition & gt; Instead of
:
& lt; Property name = "version" type = "string" & gt; & Lt; Column name = "VERSION" length = "20" /> & Lt; / Property & gt; First of all, I think this is not what you want. Second, the string is not allowed for the version field described in Chapter: The version numbers include Hibernate type long
, integer
, Small
, timestamp
or calendar
.
This problem has been reported in some way (in fact, it should be hibernate, hibernate, and should not be hired) and I look at two ways to solve it.
Manually fix mapping Give more columns to the column
Comments
Post a Comment