生成Hibernate映射文件时未创建注释 [英] Annotation not created when generating Hibernate mapping files

查看:79
本文介绍了生成Hibernate映射文件时未创建注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在跟踪此链接以生成休眠文件

I am following this link to generate hibernate file

https://www.mkyong. com/hibernate/如何使用hibernate工具生成代码/

已生成文件,但没有注释. 我检查了生成EJB3批注",但仍然无法正常工作 DB是Postgres. 我曾经以相同的方式来做,而且效果很好. 几周前,我升级到蚀食并改变了我的工作场所 从那以后它就不起作用了.. 有谁知道活动是否有日志文件?也许我可以在那找到一些东西?

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 ?

这是我的hibernate.cfg.xml文件

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>

推荐答案

花了两天时间后,我发现了问题. 我的休眠版本是5.3,并且在将休眠版本更改为5.2之后(仍在休眠配置窗口中),它仍然有效!

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

这篇关于生成Hibernate映射文件时未创建注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆