-->
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.  [ 6 posts ] 
Author Message
 Post subject: native id generator with oracle
PostPosted: Fri Nov 21, 2003 3:52 am 
Newbie

Joined: Fri Nov 21, 2003 3:36 am
Posts: 4
hi *!
i did some experimenting with the native id generator in oracle (OracleDialect). my test was simply adding a new object with a auto-generated id and a name.

here the mapping:

Code:
<class name="test" table="cbx_test">
  <id name="id" column="cbx_id" type="int" unsaved-value="-1">
    <generator class="native"/>
  </id>
  <property name="name" column="cbx_name" />
</class>

so when i added the object with Session.saveOrUpdate, nothing happened (no data in database). after turning on sql output, i recognized, that a sequence HIBERNATE_SEQUENCE was selected, and because it wasn't found (i didn't create it), update statements were performed (which did nothing).

my expectation would be that some exception will be thrown, if this sequence isn't found or if update statements return zero modified lines.

j


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 4:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You are mistaken,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 4:22 am 
Newbie

Joined: Fri Nov 21, 2003 3:36 am
Posts: 4
gavin wrote:
You are mistaken,


could you please explain that more detailed?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 4:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Well, no, its you who are missing the detail!

certainly Hibernate throws an exception if the sequence is missing.

I think you should turn on Hibernate debug logging and see whats really happening


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 4:35 am 
Newbie

Joined: Fri Nov 21, 2003 3:36 am
Posts: 4
hm. ok. maybe spring hides this exception (i use the spring hibernate template). i'll look for that.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 5:04 am 
Newbie

Joined: Fri Nov 21, 2003 3:36 am
Posts: 4
hm. now i see the exception. i swear, yesterday, there was no exception. hm. in that case, please excuse my disturbance.

j


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