On Thu, 01 Feb 2001, you wrote:
> On Jan 31, Kimpton,C (Chris) quoth:
> 
> > I want to find out how many entities I have of a particular bean, eg I have
> > a CompanyBean, is
> > there a standard countAll CompanyHome method - or can I define a custom
> > finder with jbossCMP, or 
> > do I need to go under the covers and talk directly to the DB?
> > 
> > The info is for a summary page and thus I want to avoid loading up all the
> > companies just to find the total.
> 
> The Home.findAll() method returns a Collection.  Collection.size() returns
> an int with the number of items in the collection.  This implies a limit
> of Integer.MAX_VALUE to the number of objects you can iterate over in a
> collection but I don't know what the boundary behavior of the beans and
> the Collection implementations are.

Poor practice I know, but the source for the class library comes with the JDK,
so you could have a look at how it's implemented...

My guess is that most Collection implementations will use a linked list, so
you're limited by memory, even if .size() will not be able to report extremely
large sizes.

Tom


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to