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: how to sort the derived columns using HQL and createCriteria
PostPosted: Fri Sep 26, 2008 3:23 am 
Beginner
Beginner

Joined: Fri Sep 28, 2007 4:58 am
Posts: 21
Location: Chennai, India
Hi All,

I have two tables like person and address. The relationship between Person and address are one to many. I want to display the details of person including his addresses in a single row. As shown below.
Person Address
Person_Id ID, Addr_ID
Name Street
Addr_ID City
Zip
Example:
Person Address Address
10 10, 1 20, 1
purushotham Bukkarayasamudram Perungudi
1 Anantapur Chennai
515701 600096

Person Address Address
20 11, 2 21, 2
venugopal vijayawada Perungudi
2 vijayawada Chennai
520001 600096

I want to display the records like below with sorting order.
Sno Person ID Name Address (can’t able to sort)
1 10 purushotham Bukkarayasamudram;Anantapur ; 515701
Perungudi; Chennai; 600096
2 20 venugopal Vijayawada; Vijayawada; 520001

Perungudi; Chennai; 600096

Based on the above table I can able to sort the person id and name but, I can’t able to sort the address. In my project I am using createCriteria and some of my colleagues using HQL. In both scenarios we can’t able to sort the address.

Please let me know how to sort the address’s In both scenarios. This is a critical issue in my project.

The above table shown in the jsp page using struts and display tag. I want to provide the sort column in jsp <display:column sortName="Address">

Please do the needful.

thanks in advance[/code][/list][/i]

_________________
Purushotham Podaralla


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.