开发者

Is it possible to generate Annotated Java classes using Mojo's Hibernate plug-in?

开发者 https://www.devze.com 2022-12-17 21:33 出处:网络
I know that hbm2hbmxml generates the necessary mapping files (*.hb开发者_Go百科m.xml) from a given datasource. You can then use hbm2java which will use those hbm.xml files as an input and will output

I know that hbm2hbmxml generates the necessary mapping files (*.hb开发者_Go百科m.xml) from a given datasource. You can then use hbm2java which will use those hbm.xml files as an input and will output Java classes. Is there a way of generating Java Annotated classes from the datasource without having to rely on the hbm.xml files?

Thanks.


You can use hbm2java for reverse engineering. There are the hibernate tools docs:

http://docs.jboss.org/tools/3.2.1.GA/en/hibernatetools/html_single/index.html#refeng_codegen

With the reveng file configuration you can instruct hibernate tools to create the java model from the database.

And there is one example from another SO question:

How to configure maven hbm2hbmxml and hbm2java to run one after the other in mvn clean install

0

精彩评论

暂无评论...
验证码 换一张
取 消