-->
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: Sequences with SAPDB
PostPosted: Thu Apr 08, 2004 11:59 am 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
I am using Hibernate 2.1.2 with SAPDB 7.4.

The following is a sample mapping.
Code:
<hibernate-mapping>
  <class name="com.foo.bar.beans.site.Instruction" table="INSTRUCTIONS" dynamic-update="false" dynamic-insert="false">

    <id name="instructionId" column="INSTRUCTIONID" type="java.lang.Long" unsaved-value="null">
      <generator class="sequence">
        <param name="instructionId">SEQ_INSTRUCTIONID</param>
      </generator>
    </id>
  </class>
</hibernate-mapping>


I must be missing something really obvious here because the SEQ_INSTRUCTIONID is not getting used in the database. Instead, there is a HIBERNATE_SEQUENCE that is in the database and is being incremented for inserting Instruction objects. The same is true for all my other objects. I have a different sequence specified in each mapping but all of them are using the HIBERNATE_SEQUENCE.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 08, 2004 5:00 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
This question isn't specific to SAPDB really. Is there something fundamentally wrong with the way I have the sequence specified in my mapping file?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 08, 2004 5:07 pm 
Senior
Senior

Joined: Wed Mar 24, 2004 11:40 am
Posts: 146
Location: Indianapolis, IN, USA
Never mind. I figured out why it doesn't work.

Incorrect mapping

Code:
<param name="instructionId">SEQ_INSTRUCTIONID</param>

Correct mapping

Code:
<param name="sequence">SEQ_INSTRUCTIONID</param>


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.