iliaden
iliaden

Reputation: 3889

How to generate Hibernate mapping files from Database

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 can 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?

Upvotes: 0

Views: 1754

Answers (1)

Ryan Stewart
Ryan Stewart

Reputation: 128949

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.

Upvotes: 1

Related Questions