Source code:
Entity bean home interface snippet (LookupHome.java):
public Collection findByClub_Id (String club_id) throws FinderException,
RemoteException;
Entity bean remote interface snippet (Lookup.java):
public LookupData getSourceKeyData() throws RemoteException;
Stateless session bean snippet (EditorBean.java):
.
.
.
Iterator iterator = lookupHome.findByClub_Id (club_id).iterator();
while (iterator.hasNext()) {
Lookup l = (Lookup)iterator.next();
System.err.println ("source key: " +
l.getSourceKeyData().getSourceKey());
2 beans matched the criteria. Results of the println:
source key: 017_06_cn_06_719_089K
source key: 017_06_cn_06_719_089K
What *should have* printed:
source key: 017_06_cn_06_719_089K
source key: 017_06_cn_06_719_089L
Editor bean does a findByXX() with a given club identification and returns a
Collection of remote references to matching beans (correct?). Using an
iterator, run through the list of remote references and pull out the data.
Is there something I'm doing wrong? I am using JDK 1.3 & JBoss 2.0 FINAL.
Thanks.
-----Original Message-----
From: David Castro Diephouse [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 19:23 PM
To: JBoss-User
Subject: Re: [jBoss-User] Duplicate bean results in findByXX execution
pro blem.
That's strange. How are you determining the identity of the returned beans?
Post the code + results...
"Hardy, Patrick, DDI - Garden City" wrote:
> Hello,
>
> I just read the section
> http://www.jboss.org/newsite/documentation/jawsxml_howto.html#finders on
the
> JBoss site and it says that:
>
> "for each of the cmp-fields of your bean, findByXX(YY fieldValue), where
XX
> is the name of the cmp-field (NOT case-sensitive) and YY its class, will
> return a Collection of all the beans with the right value in this field."
>
> My finder is finding the correct number of beans. However, when I go
through
> the list of beans in my collection, the collection consists of the first
> bean, n number of times. If I find 5 beans, the first bean will be in the
> collection 5 times, and not all 5 beans.
>
> Can anyone explain to me why I'm having this problem? I don't think it's
> necessary to define a WHERE clause.
>
> Thanks.
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
This message (including any attachments) contains confidential, proprietary
or privileged information intended for a specific purpose and individual(s),
and is protected by law. If you receive this message in error, please
immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender. Any unauthorized disclosure,
copying or distribution of any part of this message, or the taking of any
unauthorized action based on it, is strictly prohibited.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
RE: [jBoss-User] Duplicate bean results in findByXX executionpro blem.
Hardy, Patrick, DDI - Garden City Fri, 09 Mar 2001 05:06:05 -0800
