-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Need to create the cfg.xml files and the mapping files
PostPosted: Mon Nov 17, 2008 2:54 am 
Newbie

Joined: Wed Mar 19, 2008 3:38 am
Posts: 8
Location: Chennai, India
Hibernate version:3.0

Name and version of the database you are using:Postgresql 8.0

I am trying to access data using hibernate. But the problem is I need to create the cfg.xml file and the mapping files with the database name and its location.

Given the database name I will need to create the cfg.xml file, connect to the database, get the tables and columns details and create the mapping files.

Is there a way of doing this using hibernate?

I tried searching through the forums. But I couldn't conclude whether it is possible or not.

Can somebody help me find a solution for this?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Need to create the cfg.xml files and the mapping files
PostPosted: Mon Nov 17, 2008 6:03 am 
Newbie

Joined: Thu Aug 30, 2007 9:14 am
Posts: 6
kmsram420 wrote:
Hibernate version:3.0

Name and version of the database you are using:Postgresql 8.0

I am trying to access data using hibernate. But the problem is I need to create the cfg.xml file and the mapping files with the database name and its location.

Given the database name I will need to create the cfg.xml file, connect to the database, get the tables and columns details and create the mapping files.

Is there a way of doing this using hibernate?

I tried searching through the forums. But I couldn't conclude whether it is possible or not.

Can somebody help me find a solution for this?

Thanks in advance.


If you wish to generate the mapping files, from an existing DB, you can use the Hibernate Tools in eclipse:

http://www.wikihow.com/Generate-Hiberna ... -DB-Tables

If you have a java code and if you want to have a quick schema generation from the classes, it's good to use Hibernate Annotations

http://www.javaworld.com/javaworld/jw-0 ... tions.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 6:31 am 
Newbie

Joined: Wed Mar 19, 2008 3:38 am
Posts: 8
Location: Chennai, India
Dupa

First thanks for your help.

I did find a number of eclipse plug-ins that can help me generate the cfg.xml and the mapping files and the classes.

My problem here is I need to automate the process for any database in PostgreSQL. I shouldn't use the eclipse tools for this process. I will have to write a java code to do the work done by the eclipse plug-in tools. It is like finding whether apis are exposed by these tools to facilitate this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.