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.  [ 2 posts ] 
Author Message
 Post subject: Sequence Strategy for Oracle and now change to SqlServer
PostPosted: Fri Jul 04, 2008 12:00 pm 
Newbie

Joined: Fri Jul 13, 2007 12:58 pm
Posts: 2
Hi,

I developed an Asp.net application with VS2005 + NHibernate 1.2 + Oracle 9.2, and i have a lot of mappings width a Sequence strategy (Oracle dialect) and everything is running OK until i receive a request to have more than one database: ORACLE and SQLServer2005.

How can i run my application with SQLServer database without change ALL my mappings to remove the SEQUENCE!???

Exists any way to maintain the same mapping with differents dialects!?


Someone can help me!?


Regards,

Tony Wolfango
Portugal


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 05, 2008 7:36 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
TonyW

I thought you could just set the mapping to generator class="native"
Which will use the native/default generator strategy for the dialect that you're using... which will be IDENTITY for SqlServer and SEQUENCE for Oracle (the latter I'm guessing will be the case)

eg
<id name="id"> <generator class="native"/> </id>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.