-->
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: Problem when calling an Oracle sequence into an HQL query
PostPosted: Mon Jun 25, 2007 2:06 pm 
Newbie

Joined: Mon Apr 16, 2007 12:02 pm
Posts: 17
Hello everybody,

Hibernate version:
3.2

The following HQL statement works weel
<query name="initPortalStatusToRegistered">
<![CDATA[
insert into AttrListValue(id, panelist, attribute, selectionListValue)
select rownum, pa, at, slv.value
from Panelist pa, ApAttribute at, SelectionListValue slv
where pa.accessPanel.id = :accessPanelID
and at.name = 'PortalStatus'
and at.id = slv.attribute.id
and slv.caption = 'Registered'
]]>
</query>

But, when i replace rownum by hibernate_sequence.nextval*100; it does not work anymore

Do you have any idea please?

Thanks in advance.

Regards

Samuel


Top
 Profile  
 
 Post subject: Too easy
PostPosted: Fri Aug 31, 2007 12:25 pm 
Newbie

Joined: Mon Apr 16, 2007 12:02 pm
Posts: 17
The solution was to remove the id from the HQL, the SQL statement generated by Hibernate uses the sequence defined into the .hbm to generate the 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.