-->
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: hql help
PostPosted: Fri May 09, 2008 1:34 pm 
Newbie

Joined: Mon Apr 28, 2008 8:33 am
Posts: 2
hello guys,

a query like = from client return for me all data from client table.


Code:

   public List<T> findHQL(String query) {
      Query q = null;
      q = em.createQuery(query);
      List list = q.getResultList();
      return list;

   }

and from client,employee for example what is return for me???

list<Client> ??
list<Employee> ??


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 09, 2008 4:19 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
A list of Object arrays, containing one object per table involved.

Except for very simple queries, always specify the select list, don't use the simpler "from ..." form.

_________________
Gonzalo Díaz


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.