Thomas Hagedorn writes:
> On Mon, 13 Nov 2000, you wrote:
> > |Hi there,
> > |
> > |in a BMP entity bean, I tried to implement a findermethod
> > |'findByName(String
> > |name)' which does a select on a table 'where name like ...' , collects the
> > |resulting primary key fields (String) in a Vector and returns an
> > |Enumeration
> > |with vector.elements(). A debugstatement in the
> > |UserBean.ejbFindByName(String
> > |name) reports the expected values.
> > |In a testclient I wrote, findByPrimaryKey works fine, but if I try
> > |to iterate
> > |over the Enumeration returned by 'findByName(String name)' (with
> > | 'String key = userList.nextElement().toString()'), I got
> > |jndi-ref-name + ":" +
> > |expected-key instead of expected-key.
> > |Any hints what I'm doing wrong ??
> > |BTW: I'm using Beta3 with jdk1.3 on Solaris
> >
> > if you system.out then the logger prepends with your bean name that is
> > normal.
> >
> > marc
> Maybe I was not clear enough.
> system.out from within the bean is ok (I know about the prepending bean name)
> but the values in the enumeration has a prepending jndi-reference name!
> Example: I lookup for "ims/User", get my interface, call my finder and recieve
> an Enumeration of Strings (representing the primary key).
> >From within the ejbFindXXX method, I get "foobar23" as a value but in my client
> I got "ims/User:foobar23" ! .. and I'm still wondering why.
Erm... fools rush in where angels fear to tread and all... but doesn't
findByXXX return a collection of remote interfaces? Not a collection
of primary keys? Someone tell me I'm right here, please?
Section 8.3.2:
"The return type of a finder method must be the entity bean's remote
interface, or a type representing a collection of objects that
implement the entity bean's remote interface (see Subsection 9.1.8)."
Tom
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]