-->
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.  [ 1 post ] 
Author Message
 Post subject: Can we have two Hibernate configuation files?
PostPosted: Tue Nov 11, 2008 3:10 am 
Newbie

Joined: Sat Oct 11, 2008 3:31 am
Posts: 11
Can we have two Hibernate configuation files in one Hibernate Application?

I know it sounds something different!!! but My problem is .....

I want to restore values into data base.For that i simply read the xml file

and insert into the database. File is like this
<?xml version="1.0" encoding="UTF-8" ?>
- <events.error_log>
- <error_log>
<uid>19745</uid>
<item_identity_code>000401</item_identity_code>
<module_name>Return To Vendor</module_name>
</error_log>
- <error_log>
<uid>19746</uid>
<item_identity_code>000402</item_identity_code>
<module_name>Return To Vendor</module_name>
</error_log>
- <error_log>
- </events.error_log>
Before Inserting I check whether particular row (error_log tag contains entire row data)

exist or not where uid='19745' and so on (uid is primary key)!! if not I insert it. But my uid value in file is '19745' and for restoring i need that value to be inserted in database only perhaps while insering it uses geneator class specified for that class. if error_log has generator class as 'native' then hibernate will use its own sequence for 'uid' coloumn. instead if generator class used as 'assigned' it will insert only that value for uid ie. '19745'.

My view of solving this is to create one more hibernate configuaration file which contains same list of mapping hbm files but packeges are different (e.g:now it is <mapping resource="events/error_log.hbm.xml"/> instead of that use new one i.e. <mapping resource="Newevents/error_log.hbm.xml"/>) and all of this hbm file will contain generator class as 'assigned'.

please suggest me some right view

Thankyou........................[/list][/code]


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.