转换基于XML的配置注解 [英] Convert XML based configuration to Annotations
问题描述
是否有可用的转换基于XML配置文件的任何实用程序注释(在春季或休眠说)?如果没有这将是值得建立这样一个工具?
去以下页
https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html
和见项目4.4.2。
POJO的Java code出口(小于调用:hbm2java>)
它说:
<&调用:hbm2java GT;是一个java codegenerator。控制阉JDK 5语法选项可以用来和是否POJO应EJB3被标注/ Hibernate注解
块引用>< hibernatetool DESTDIR =$ {} build.dir /生成>
<结构的ConfigurationFile =hibernate.cfg.xml中/>
<调用:hbm2java JDK5 =真EJB3 =真/>
< / hibernatetool>关于EJB3的属性,它说:
code将包含EJB 3的功能,例如使用注释从javax.persistence和org.hibernate.annotations
块引用>Is there any Utility available to convert XML based config files (say in Spring or Hibernate) to Annotations? If not would it be worthwhile to build such a tool?
解决方案Go to the following page
https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html
And see item 4.4.2.
POJO java code exporter (<hbm2java>)
It says:
<hbm2java> is a java codegenerator. Options for controlling wether JDK 5 syntax can be used and whether the POJO should be annotated with EJB3/Hibernate Annotations.
<hibernatetool destdir="${build.dir}/generated"> <configuration configurationfile="hibernate.cfg.xml"/> <hbm2java jdk5="true" ejb3="true"/> </hibernatetool>
About ejb3 attribute, it says:
Code will contain EJB 3 features, e.g. using annotations from javax.persistence and org.hibernate.annotations
这篇关于转换基于XML的配置注解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!