用于创建休眠注释实体的 eclipse 插件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7726091/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
eclipse plugin to create hibernate annotated entities?
提问by Mahmoud Saleh
i know that hibernate tools can create hibernate entities but the hibernate mapping will be in XML file, but i was wondering if there's a tool to create hibernate entities and the mapping will be with annotations not in XML.
我知道休眠工具可以创建休眠实体,但休眠映射将在 XML 文件中,但我想知道是否有创建休眠实体的工具,并且映射将带有不在 XML 中的注释。
回答by Ken Chan
Hibernate tools can also generate the annotated entities by reverse engineering of your database. You have to choose Generate EJB3 annotations
and Domain code(.java)
. Refer to the 4.5. Reverse Engineering and Code Generationmore info.
Hibernate 工具还可以通过对数据库进行逆向工程来生成带注释的实体。你必须选择Generate EJB3 annotations
和Domain code(.java)
。参见4.5。逆向工程和代码生成更多信息。
回答by Max Rydahl Andersen
Write your java code and use Source > Generate Hibernate/Jpa annotations and hibernate tools will do an attempt to add necessary annotations based on that
编写您的 java 代码并使用 Source > Generate Hibernate/Jpa annotations 和 hibernate 工具将尝试基于该注释添加必要的注释