-->
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: Named Queries in Hibernate
PostPosted: Fri Feb 23, 2007 4:01 pm 
Newbie

Joined: Wed Nov 22, 2006 5:09 pm
Posts: 8
Hi Friends,

I have a issue using named queries in hibernate. I have defined the followinf query in my mapping file (This mapping file just has SQL qureies)



Code:
   <sql-query name="GET_PERMISSIONS">
      <![CDATA[
         SELECT
            permission_id,
            permission_name,
            permission_desc
         FROM
            bsl_permission
         WHERE
            function_id = ?
         ORDER BY
            permission_name
        ]]>
   </sql-query>


How do i get the results.

Thanks In Advance - Amit


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 23, 2007 7:22 pm 
Regular
Regular

Joined: Sun Sep 17, 2006 2:48 am
Posts: 81
Location: California
Use session.getNamedQuery("GET_PERMISSIONS") to get the query. Set values in the query and then call list(). I am not sure if SQLQuery works like this, but I have certainly used HQL like this.


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.