Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Annotation not created when generating Hibernate mapping files

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>

like image 796
RMagen Avatar asked Nov 30 '22 08:11

RMagen


1 Answers

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 !!

like image 196
RMagen Avatar answered Dec 31 '22 13:12

RMagen