-->
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: Find query function .... Question
PostPosted: Fri Oct 01, 2004 11:56 am 
Newbie

Joined: Fri Oct 01, 2004 11:48 am
Posts: 3
Hibernate version:
Hibernate 2.1.4
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
Oracle 8.1.7
The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

If i write a following query

select c1.name, c2
from c1 in class c1class, c2 in class c2class
where c1.key = c2.key

List list = session.find(qry)

How do i get the two selected items in two different persistant classes? Is something like this possible? If i select only c1.name or c2 alone the query works.

I get the following error "java.lang.Object" when the next() executes from the list.

Any suggestions?

Thanks

-Naren


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 01, 2004 1:51 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
you get a Object[] per list element
so
object[0] is c1.name --> cast it to (String)
object[1] is c2 --> cast it to.... you know ;)

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.