cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Results from Table

Former Member
0 Kudos

Hello,

my EJB Query hast multiple Results.

My Table:

key | value

-

-


01 | test1

02 | test2

My Selection:

select Object(b) from PhoneBookEntityBean b

What kind of result type must the finder method have and how can i handle it?

Thanks for help and ideas,

André

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Problem solved,

I found my failure.

Former Member
0 Kudos

Hi

I'm having problem with my finder method also...

I have a finder with name findByEmpName in which I pass string “empname” as parameter, for this I have put following in my ejb-jar.xml:

<query>

<query-method>

<method-name>findByEmpName</method-name>

<method-params>

<method-param>java.lang.String</method-param>

</method-params>

</query-method>

<ejb-ql>select object(b) from TestEntityBean b where b.empName like ?1</ejb-ql>

</query>

and inside persistent.xml

<finder-descriptor>

<method-name>findByEmpName</method-name>

<method-params>

<method-param>java.lang.String</method-param>

</method-params>

<load-selected-objects/>

</finder-descriptor>

but when I use this finder method in my jsp, it return me null (no rows) but corresponding row is present in the database, findByPrimaryKey and create are working fine...

Is any other setting need to be done?? pls help!!

~Raj

Former Member
0 Kudos

Hi Rajender,

have you tried to select all entries from the table? So you can check if your statement is corrupt.

Regards,

André

Vlado
Advisor
Advisor
0 Kudos

Hi Raj,

First of all, it is enough to post your question only once, even more in the same forum.

Now, this is probably a transaction boundaries problem. For an explanation on the topic look at

Best regards,

Vladimir