-->
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.  [ 4 posts ] 
Author Message
 Post subject: Oracle and Sequence - how?
PostPosted: Sat Jul 16, 2005 1:10 pm 
Newbie

Joined: Thu Jul 21, 2005 3:02 am
Posts: 11
Our database has a sequence for every table. How do I tell NH to use those sequences?

Regards Morten


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 21, 2005 5:57 pm 
Beginner
Beginner

Joined: Wed Jun 01, 2005 3:22 pm
Posts: 38
Location: Menlo Park, CA
<class ...>
<id ...>
<generator class="sequence">
<param name="sequence">name.of.your.sequence</param>
</generator>
</id>
<!-- other properties -->
</class>

It's in the docs.


Top
 Profile  
 
 Post subject: oracle sequence incrementing twice
PostPosted: Fri Oct 28, 2005 1:16 pm 
I'm using similar mapping for oracle sequences, and I'm finding that the primary keys are getting incremented twice. Has anyone else ran into this?

thanks,

s


Top
  
 
 Post subject: found the answer to my question
PostPosted: Fri Oct 28, 2005 1:50 pm 
I ported a ms sql server database over to oracle using the oracle WorkBench tool. It automatically generates triggers, which call your sequence on inserts. So both the trigger and nhibernate were incrementing the sequence value. I removed the triggers and all is well. There is a similar "oracle trigger" post on this forum...but, I missed it earlier.


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