-->
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: Next value from a Oracle sequence
PostPosted: Wed Aug 23, 2006 6:15 pm 
Newbie

Joined: Wed Aug 23, 2006 5:15 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]

Hi..

I am using Hibernate 3.1 with Oracle 8
I am trying to get the next value from a sequence.
My sequence name is userId

I tried session.createQuery("select userId.nextVal from dual");
but hibernate returns with "dual not mapped"

Any help is really appreciated,
Shanth


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 6:19 pm 
Newbie

Joined: Thu May 04, 2006 5:04 am
Posts: 17
Location: Austria
You have to use createSQLQuery instead of createQuery (HQL Query) because you are trying to execute a native SQL query,

_________________
Please don't forget to rate the posting if it helped you, thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 7:09 pm 
Newbie

Joined: Wed Aug 23, 2006 5:15 pm
Posts: 2
Thanks a lot ChristianS


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.