• 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

re. export and update utility of Hibernate and mapping xml files

 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to Hibernate. I have been reading hibernate document online, but could not figure out exactly about few things :

- About export utility for database schema. It requires mapping xml files. What does this utility do. I mean if it creates classes - for database tables? and about mapping xml file- if there any utility to generate those xml files by going thru the database schema, instead of writing those files manually.
- and for update utility re. database schema again we have to modify the xml file first and then run this utility to re-create new class files for database schema. Am I right?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This all depends on which utility you are talking about. Hibernate does have command line tools to generate POJO class files from XML mapping files and viceversa. It also has tools to change a DB schema dependant on changes made to the mapping files. There are also third party tools unconnected with Hibernate whic hcan do this (such a middlegen).
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hibernate does have command line tools to generate POJO class files from XML mapping files and viceversa.



Does hibernate has tools for generating mapping xml files without POJO class files. as you said it can be done vice versa means either of the two must be present.

I have to work on a project where I don't know anything about what database may be used, or what can be its database schema. I need to get database schema,generate entity beans or I can also just rely on hibernate for persistence layer.

My application will be later on used by another developer to customize it according to a particular business module. We are planning to use jboss as application server and ejbs for the final customized application.

I want to develop something like Middlegen but without the another developer specifying table and their relationship as I saw it on middlegen web site frontpage. My application will generate the persistence classes and then cmp beans.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Middlegen is the closest to what you need. Check here for a brief overview of the tools. I assume your project is not a commercial project - otherwise you wouldn't be able to incorporate any of these other tools into it. In which case you might consider contacting one of the groups developing these tools, as the extra functinality you propose might be useful as part of their product.
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies!!
I read the link- so they are already considering about direct xml generation.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic