aspose file tools*
The moose likes Object Relational Mapping and the fly likes re. export and update utility of Hibernate and mapping xml files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "re. export and update utility of Hibernate and mapping xml files" Watch "re. export and update utility of Hibernate and mapping xml files" New topic
Author

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

Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
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?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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).


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
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

Joined: Apr 14, 2004
Posts: 10336

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

Joined: Oct 18, 2004
Posts: 346
Thanks for your replies!!
I read the link- so they are already considering about direct xml generation.
 
 
subject: re. export and update utility of Hibernate and mapping xml files
 
Similar Threads
JBOSS w/ Eclipse building CMP EJB
XML To DataBase
hibernate mapping
How to automate insert statement using hibernate config file
JDBC vs DB2 Export - Performance