-->
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: Query to get special results, not a mapped class...
PostPosted: Thu Feb 19, 2004 6:48 am 
Beginner
Beginner

Joined: Fri Feb 06, 2004 6:59 am
Posts: 36
Location: S
Hi, using hibernate 2.1.2.

I am doing a simple query like this:

select a.code, b.description, c.min(students), c.max(students)
from com.here.beans.BeanC c,
inner join c.description_table b, c.codes a
group by a.code, b.description

the results of this query is not a persister class....so I don't know hou I can get this values, when I try to execute it from hibernate IDE it works really fine, but within java id warns me this:

no persistent classes found for query class: select a.code, b.description, c.min(students), c.max(students) ...

Again, this query works on Hibernate IDE, but how to get this values within java class?

_________________
Best Regards,
Ernani Joppert Pontes Martins


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 6:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Code:
List result = session.find("select a.code, b.description, c.min(students), c.max(students)
from com.here.beans.BeanC c,
inner join c.description_table b, c.codes a
group by a.code, b.description ");
Object[] row = result.get(0);
String acode = row[0];


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Thu Feb 19, 2004 6:53 am 
Beginner
Beginner

Joined: Fri Feb 06, 2004 6:59 am
Posts: 36
Location: S
Thanks Michael...

It really works fine here...

_________________
Best Regards,
Ernani Joppert Pontes Martins


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.