-->
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 get nested DTO from HQL ??
PostPosted: Tue Jul 15, 2008 10:52 am 
Newbie

Joined: Tue Jul 15, 2008 10:40 am
Posts: 1
Hi there.

How can I get a nested DTO from HQL ??
Is it possible to do this like that:


Code:
String query = "select new IndustryLabelDTO(label.name, label.number, (select new IndustryDTO(industry.name, industry.urlName) from Industry industry where industry.label = label)) FROM IndustryLabel label ORDER BY label.number ASC, label.name ASC";


DTOs:

Code:
public class IndustryLabelDTO {

   public String name;
   public int number;
   public List<IndustryDTO> industries = new ArrayList<IndustryDTO>();

}

public class IndustryDTO {

   public String name;
    public String urlName;

}



Thank you for any idea. Tomas


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.