• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic