-->
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.  [ 5 posts ] 
Author Message
 Post subject: query.list() and criteria.list() and findall() ...
PostPosted: Thu May 26, 2005 7:46 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
Hi all


i have a simple question :

with hibernate 2.1.7 when i run query.list() and findAll() ...
and all methods that return a list. the return value if list was emty
is a java.util.ArrayList with zero size 0;

but sometime i get a EmptyList Object. and when i try to cast it to ArrayList
i have a CalssCastExcetion because ArrayList and EmptyList was deferent.


here my question :

whan i got EmptyList and when zero size ArrayList. ???????


please help.
thanks all.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 8:00 am 
Regular
Regular

Joined: Tue Jan 27, 2004 12:22 pm
Posts: 103
Always cast to List when a List is to be expected, don't cast to ArrayList. The underlaying implementation of List shouldn't be your concern.

_________________
Dencel
- The sun has never seen a shadow -


Top
 Profile  
 
 Post subject: about my problem
PostPosted: Thu May 26, 2005 8:17 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
tanks Dencel..... but its not my question.


my question is :

when hibernate return me EmptyList and when it returns me zero size ArrayList ???


i just want to know it.


Top
 Profile  
 
 Post subject: about my problem
PostPosted: Thu May 26, 2005 8:18 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
tanks Dencel..... but its not my question.


my question is :

when hibernate return me EmptyList and when it returns me zero size ArrayList ???


i just want to know it.

it seems that in previous versions of hibernate it return Empty List
and in new versions returns zero size ArrayList.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 10:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
So .... look at the code?


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