To return several references from a find method, you must use Collection
type. A find method that uses this return type may have duplicates.
ps: in CMP 2.0, Collection is the only collection type supported for
multi-entity find methods.

And to return several references from a select method, you must declare the
return type to be either Collection or Set. But, Set return type will not
have duplicate values while Collection return type may have.


[]'s
Tania Ramos

>-----Mensagem original-----
>De: conrad [mailto:[EMAIL PROTECTED]]
>Enviada em: terça-feira, 23 de julho de 2002 13:30
>Para: [EMAIL PROTECTED]
>Assunto: Re: [JBoss-user] JBossQL
>
>Hmmm....I suppouse it doesn't matter that i hav find method
>
>
>
>Dnia 2002-07-23 14:09, Użytkownik Emerson Cargnin - SICREDI Serviços
>napisał:
>> I made a dynamic selection that returns a set :
>>
>>  public abstract java.util.Set ejbSelectGeneric(String jbossql, Object[]
>> arguments)
>>       throws javax.ejb.FinderException;
>>
>> jbosscmp-jdbc.xml:
>>
>>          <query>
>>             <query-method>
>>                <method-name>ejbSelectGeneric</method-name>
>>                <method-params>
>>                   <method-param>java.lang.String</method-param>
>>                   <method-param>java.lang.Object[]</method-param>
>>                </method-params>
>>             </query-method>
>>     <dynamic-ql/>
>>          </query>
>>
>>
>> xdoclet tags:
>>
>>
>>  @ejb:select
>>  *    signature="java.util.Set ejbSelectGeneric(java.lang.String
>> jbossql, java.lang.Object[] arguments)"
>>  *    query=""
>>  *       result-type-mapping="Local"
>>  *
>>  *  @jboss:query signature="java.util.Set
>> ejbSelectGeneric(java.lang.String jbossql, java.lang.Object[]
>> arguments)" dynamic="true"
>>
>>
>> ejb-jar.xml :
>>
>>  <query>
>>     <query-method>
>>                <method-name>ejbSelectGeneric</method-name>
>>                <method-params>
>>                   <method-param>java.lang.String</method-param>
>>                   <method-param>java.lang.Object[]</method-param>
>>                </method-params>
>>             </query-method>
>>             <result-type-mapping>Local</result-type-mapping>
>>             <ejb-ql><![CDATA[]]></ejb-ql>
>>          </query>
>>
>> conrad wrote:
>>
>>> Hi
>>>
>>> I've solved the problem
>>>
>>> The find method can't return java.util.Set because underlaying
>>> java.util.ArrayList doesn't implement Set interface - at least I think
>>> so :-). Solution was to change it to Collection :-)
>>>
>>> Cheers
>>>
>>> Dnia 2002-07-23 12:26, Użytkownik conrad napisał:
>>>
>>>> Hi all
>>>>
>>>> I'm trying to use JBossQL
>>>>
>>>> I've "declared" dynamic find method in jbosscmp-jdbc.xml
>>>> -----
>>>> <query>
>>>>     <query-method>
>>>>     <method-name>findDynamic</method-name>
>>>>         <method-params>
>>>>             <method-param>java.lang.String</method-param>
>>>>             <method-param>java.lang.Object[]</method-param>
>>>>         </method-params>
>>>>     </query-method>
>>>>     <dynamic-ql/>
>>>> </query>
>>>> ----
>>>>
>>>> in runtime built query:
>>>>
>>>> SELECT OBJECT (o) FROM User o WHERE o.id=?1  OR o.id=?2 OR o.id=?3 OR
>>>> o.id=?4
>>>>
>>>> and got such exception:
>>>>
>>>> 11:44:40,033 ERROR [STDERR] [CONRAD] UserManager  get0
>>>> 11:44:40,035 ERROR [STDERR] java.lang.ClassCastException:
>>>> java.util.ArrayList
>>>> 11:44:40,051 ERROR [STDERR]     at $Proxy1230.findDynamic(Unknown
>>>> Source)
>>>> .....
>>>>
>>>> jboss.3.0.1RC1
>>>> "id"  is a String object
>>>>
>>>>
>>>> Does anybody could tell what am I doing wrong?
>>>>
>>>> Cheers
>>>>
>>>> Conrad
>>>>
>>>> PS. whole StackTrace in attachment
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This sf.net email is sponsored by:ThinkGeek
>>> Welcome to geek heaven.
>>> http://thinkgeek.com/sf
>>> _______________________________________________
>>> JBoss-user mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>>>
>>>
>>
>>
>
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>JBoss-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to