-->
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.  [ 1 post ] 
Author Message
 Post subject: Little mistake in the Help Files
PostPosted: Wed Jun 08, 2005 5:35 pm 
Newbie

Joined: Wed Jun 08, 2005 5:22 pm
Posts: 1
Hi!

There is a little mistake in the example code of the documentation in the section:

11.4.1.3. Scalar results

Code:
while ( results.hasNext() ) {
    Object[] row = results.next();     <---  needs a cast
    Color type = (Color) row[0];
    Date oldest = (Date) row[1];
    Integer count = (Integer) row[2];
    .....
}


there needs a cast in the line marked

Code:
Object[] row = (Object[])results.next();


But not all the time because may be only 1 object the result,
in that case, there must be:

Code:
Object row = results.next();


it depends on the HQL sentence.

Cheers

Ahumaro[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.