Annotation not created when generating Hibernate mapping files

时光毁灭记忆、已成空白 提交于 2020-01-02 08:11:23

问题


I am following this link to generate hibernate file

https://www.mkyong.com/hibernate/how-to-generate-code-with-hibernate-tools/

the files are generated but without annotation. I checked the "generate EJB3 annotation " but still it is not working the DB is Postgres. I use to do it the same way and it was working fine.. few weeks ago I upgrade to eclipse to oxygen and change my workplace since then it is not working.. does any body know if there is a log file for the activity ? maybe I can find some thing there ?

this is my hibernate.cfg.xml file

    <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
    <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
    <property name="hibernate.connection.password">password</property>
    <property name="hibernate.connection.url">jdbc:postgresql://xxxxx/yyy</property>
    <property name="hibernate.connection.username">user</property>
    <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <!-- <property name="hibernate.enable_lazy_load_no_trans">false</property> -->
    <property name="hibernate.search.autoregister_listeners">true</property>
    <property name="hibernate.validator.apply_to_ddl">false</property>
    <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property>
    <property name="hibernate.enable_lazy_load_no_trans">true</property>


</session-factory>


回答1:


After spending two days on it , I found the problem.. my hibernate version is 5.3 and still after changing the hibernate version to 5.2 (in the hibernate configuration window ) - it worked !!




回答2:


After changing different possibilities in the configuration and connection, I changed the hibernate version from 5.3 to 5.2 and it works now ! (Tested on Photon and Oxygen versions of Eclipse)



来源:https://stackoverflow.com/questions/50837574/annotation-not-created-when-generating-hibernate-mapping-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!