-->
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: How can i print the search result
PostPosted: Wed Mar 17, 2004 4:08 am 
Newbie

Joined: Wed Mar 17, 2004 4:03 am
Posts: 2
such as:
......
"select c.name from model1 as c";
List list = q.list();
......
for (int i=0;i<list.size();i++){
Object o = list.get(i);
System.out.println();????????
}
How can i get the name value and print out?


Top
 Profile  
 
 Post subject: i have find the idea
PostPosted: Wed Mar 17, 2004 4:18 am 
Newbie

Joined: Wed Mar 17, 2004 4:03 am
Posts: 2
i debug the List and find the datas in list are Object[] type.the answer listed:
Object[] o = (Object[])list.get(i);
System.out.println(o[0].toString()+"-------"+o[1].toString());


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 4:41 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the documentation.

http://www.hibernate.org/hib_docs/refer ... anguage-s4

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.