-->
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.  [ 1 post ] 
Author Message
 Post subject: Named Query - Execute query only
PostPosted: Mon Jan 09, 2006 8:48 am 
Newbie

Joined: Tue Dec 06, 2005 10:13 am
Posts: 17
I have a named query, which generates a temporary table:

Code:
<sql-query name="temp">
     <![CDATA[     
CREATE TEMPORARY TABLE tmp
SELECT
   xx.id
FROM
   xx
WHERE
   xx.id = 250
</sql-query>


When I try to run this query with:
Query q = session.getNamedQuery("temp");
q.list();

I get an exception regarding no return values. I tried searching for other methods than q.list();, but found nothing.

I there some way of just executing a named query with no parameters.
By the way, I don't want to use regular JDBC connection, since I use Hibernate parameters mechanism, allowing me passing named parameters and use hibernate objects as query parameters.[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.