-->
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: Stored Proc result sorting
PostPosted: Wed Sep 03, 2008 11:53 am 
Newbie

Joined: Wed Sep 03, 2008 11:39 am
Posts: 4
Hi,

I have a SP which do not have a parameter to sort the result. (I can not pass the "order by" clause as a IN parameter.) I do not have access to change the SP & even if I change ; it will affect many other applications.

So, I want to sort the result set (which is a refcursor) on a perticular attribute name in java. Is there any way to do that ?

My DB is oracle 10i. JDK 1.5. Hibernate 3.x.

Here is the SP :

Code:
Create or replace  PROCEDURE my_borrow (
        p_ret_cur                 OUT      sys_refcursor,
       in_group_id                NUMBER
)...........sp code

Here is Java code :
Code:
Query proc = SessionFactory.getCurrentSession().getNamedQuery("my_borrow");
proc.setParameter("in_group_id", 1123);
List list= proc.list();


I want the list sorted on the some attribute. (I can do that using comparator, but I want to know is there any way with hibernate to achieve this? May be using somewhat similar to Criteria class ?). Any help is appriciable.
Thanks


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.