This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Schema to xxx.hbm.xml

 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there an open-source tool to generate *basic* hibernate mapping files (.hbm.xml)? at least column/field names and then we can edit the relationship etc.

we have plan to use Hibernate framework but find it's time consuming to write down .hbm.xml for all tables (50+) from scratch.

thanks all
tony
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Karta:
is there an open-source tool to generate *basic* hibernate mapping files (.hbm.xml)? at least column/field names and then we can edit the relationship etc.

we have plan to use Hibernate framework but find it's time consuming to write down .hbm.xml for all tables (50+) from scratch.

thanks all
tony


Middlegen might help. There are Ant tasks, too.

You need three things: (1) Schema, (2) Java objects, and (3) Hibernate mappings. You need two out of three to generate the third.

If you generate mappings straight from tables, I think that implies an assumption that the objects map 1:1 with the tables, and the attribute names match the column names. Is that what you want?
 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Middlegen might help. There are Ant tasks, too.

You need three things: (1) Schema, (2) Java objects, and (3) Hibernate mappings. You need two out of three to generate the third.
If you generate mappings straight from tables, I think that implies an assumption that the objects map 1:1 with the tables, and the attribute names match the column names. Is that what you want?


Yes, that's what we want. just plain one to one mapping and then we can edit them manually.

where I can find that ant task? any pointer really appreciated.

thanks again
tony
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic