Hi
I have already used annotation for the reverese engineering and also used the addAnnotatedClass to add the generated class to the session factory. A simple scenario in which this failure can be reproduced is to have the following: 1. Have a SQL table with version field in it as an integer type. 2. Then use the hibernator reverse engineering tool to reverse engineer the table and get a beans out (with annotations). 3. Inside the annotated Beans, you should see a method called getVersion() (and I think it conflicts with some other getVersion used internally by hibernate which seems to expect a VersionType).
4. Similarly, if you generate a .hbm.xml from the same reverse engineering process you will see the xml for this field"version" in the table marked with <version> ... <\version> instead of <property> .... </property>. The only way I have found so far to fix the problem is to open this file and change the version to property and then create the sessionFactory by using the hbm.xml.
If I use the addAnnotatedClass option, I cannot do this fix by myself and it doesn't work and throws the cast exception. Hence my question.
|