开发者

How to generate Hibernate mapping files from Database

开发者 https://www.devze.com 2023-03-25 06:53 出处:网络
I have both a schema that served in the creation of my database, as well as the database itself. I\'m wondering if there exists any tool that ca开发者_运维技巧n create a Hibernate mapping for the ent

I have both a schema that served in the creation of my database, as well as the database itself.

I'm wondering if there exists any tool that ca开发者_运维技巧n create a Hibernate mapping for the entities specified in the schema.

My preference would be for the tool to generate Object files with annotations, but if that is impossible, then I will have to accept XML annotations.

I am aware of Hibernate Code Generation that is part of JBoss tools, but I haven't been able to configure it to generate annotations.

Does anyone have any advice on how to proceed?


By "Hibernate Code Generation", do you mean the reverse engineering tool? That's the only thing I know of for generating things from a database schema for Hibernate. I don't think there's a single-step solution to go from schema to annotated classes, but if you use the reverse engineering tool to generate XML mapping files, you could then use the POJO exporter to generate annotated classes from the XML.

0

精彩评论

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

关注公众号