-->
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: Get collections as List in select clause...
PostPosted: Wed Aug 30, 2006 10:07 am 
Newbie

Joined: Wed May 24, 2006 9:30 am
Posts: 7
Hi All,

My requirement is as follows

We have two tables

Table: ADMIN
Columns:
Code:
ADMIN_ID    NAME   TYPE
1          aname    T1

Hibernate Entity: Admin

Table: ROLES
Columns:
Code:
ADMIN_ID      ROLE
1             user admin
1             group admin

Hibernate Entity: Roles

One Admin can have many Roles.

I was writing following SQL in old implementation
select a.NAME, (select CAST(MULTISET(b.ROLE) as ILIST) from ROLES b) from ADMIN a where a. ADMIN_ID=b.ADMIN_ID;

Here ILIST is oracle CUSTOM object as follows
CREATE TYPE ILIST AS TABLE OF VARCHAR2(120);

Result of above query is String aname and Array (user admin, group admin)

I want to do the same in HQL. Is it possible in anyway in HQL?? I read alsmost everything on internet about hibernate but didnt get anything.
I dont want to get data like
Code:
aname    'user admin'
aname    'group admin'

here aname is repeating.

The queries in my system are complex and its difficult to process the result to remove redundancy.

Please help me in this regard, any links, code, suggestion or utility will be appreciated.


Top
 Profile  
 
 Post subject: issue resolved
PostPosted: Wed Sep 06, 2006 7:25 am 
Newbie

Joined: Wed May 24, 2006 9:30 am
Posts: 7
check this
http://www.hibernate.org/393.html


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.