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: How to write single mapping for multiple database?
PostPosted: Fri Sep 16, 2005 8:45 am 
Newbie

Joined: Fri Sep 16, 2005 8:22 am
Posts: 2
Hi All,
How can write single mapping for multiple database? Ie My hbm file should work in MySql as well as Oracle.I have used "native" generator class also.But no luck.
Is it possible ? Or Should I use different file for each database?
Can any one please help me?

Thanks in advance.

Regards,
Prabakar.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 8:55 am 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
No, you don't need to use different mappings for different DB dialects. Using the native id generator works fine in both MySQL and ORACLE.

You might need to supply some parameters to the native ID generator, that's all. Specifically, when you are using ORACLE you can supply a sequence name. This is ignored when you are using a DB dialect that doesn't support sequences (e.g. SQLServer or MySQL).

Anyway, if you can't get this to work for you it is most likely a problem in your mapping (which you didn't post so I can't help you with that... please read the posting guidelines :) ).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 1:58 am 
Newbie

Joined: Fri Sep 16, 2005 8:22 am
Posts: 2
joshua wrote:
No, you don't need to use different mappings for different DB dialects. Using the native id generator works fine in both MySQL and ORACLE.

You might need to supply some parameters to the native ID generator, that's all. Specifically, when you are using ORACLE you can supply a sequence name. This is ignored when you are using a DB dialect that doesn't support sequences (e.g. SQLServer or MySQL).

Anyway, if you can't get this to work for you it is most likely a problem in your mapping (which you didn't post so I can't help you with that... please read the posting guidelines :) ).



Thanks .It woks fine.The problem is with the mapping file.

Regards,
Prabakar.


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