• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database Schema to xxx.hbm.xml

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic