-->
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.  [ 3 posts ] 
Author Message
 Post subject: hat dafür jemand eine lösung ?
PostPosted: Sat Dec 20, 2008 1:49 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 11:32 am
Posts: 25
Location: Austria/Vienna
ich habe in etwa das selbe problem mit einer criteria.

hat jemand eine lösung dafür ?

ich glaube eher nein. siehe:

http://opensource.atlassian.com/project ... e/HHH-1509


Last edited by cgs on Sat Dec 20, 2008 4:16 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 5:25 pm 
Senior
Senior

Joined: Thu Jan 08, 2009 3:48 pm
Posts: 168
Etwas später aber in HQL gehts recht einfach (zumindest auf das count(*) bezogen):

Code:
Query query = session.createQuery("select u, u.products.size from User u");
ArrayList<Object> list = (ArrayList<Object>)query.list();


Quote:
Hibernate:
select
user0_.ID as col_0_0_,
(select
count(products1_.user_id)
from
USER_PRODUCTS products1_
where
user0_.ID=products1_.user_id) as col_1_0_,
user0_.ID as ID0_,
user0_.username as username0_,
user0_.password as password0_,
user0_.title as title0_,
user0_.firstname as firstname0_,
user0_.lastname as lastname0_,
user0_.email as email0_,
user0_.account_id as account8_0_
from
USERS user0_



lg

Patrik


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2009 7:08 pm 
Senior
Senior

Joined: Thu Jan 08, 2009 3:48 pm
Posts: 168
Du kannst ulist[0] aber problemlos auf (User) casten, funktioniert ausgezeichnet.
Was versprichst Du Dir anderes von einer Liste aus Beans?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.