Having ORDER BY in finder method queries is futile. Iterators of
java.util.Collection are not required to return objects in any kind of
order.

Regards, Markus Holmberg.

On Fri, Mar 30, 2001 at 09:35:20PM +0700, Meo Van Le wrote:
> Dear all,
>       Could you tell me how to pass an ORDER BY parameter ( ASC or DESC )
> for a finder-method of Container-Managed bean?
>       
>       For example:
>               I have an Entity Bean was deployed as a Container-Managed
> bean. The following lines were extracted from my orion-ejb-jar.xml:
>       
>               <entity-deployment name="psv.rws.ejbs.RwsGroup"
> table="Rws_Group" data-source="jdbc/RWS_EJB_DS">
>                       <primkey-mapping>
>                               <cmp-field-mapping name="groupId"
> persistence-name="rws_group_id" />
>                       </primkey-mapping>
>                       <cmp-field-mapping name="groupName"
> persistence-name="rws_group_name" />
>                       
>                       <finder-method query="$1=$groupName ORDER BY
> $groupName ASC">
>                               <method>
>       
> <ejb-name>psv.rws.ejbs.RwsGroup</ejb-name>
>       
> <method-name>findByGroupNameAsc</method-name>
>                                       <method-params>
>       
> <method-param>java.lang.String</method-param>
>                                       </method-params>
>                               </method>
>                       </finder-method>                        
>                       <finder-method query="$1=$groupName ORDER BY
> $groupName DESC">
>                               <method>
>       
> <ejb-name>psv.rws.ejbs.RwsGroup</ejb-name>
>       
> <method-name>findByGroupNameDesc</method-name>
>                                       <method-params>
>       
> <method-param>java.lang.String</method-param>
>                                       </method-params>
>                               </method>
>                       </finder-method>                        
>               </entity-deployment>
> 
>       I have to write 2 finder methods for an normal finder method with
> ascending order and descending order: findByGroupNameAsc and
> findByGroupNameDesc.
>       
>       Are there any way to combine them become a finder method?
> 
> Thanks in advance!
> ----------------------------------------------------------------------------
> ------
> *     Le Van Meo
> *     Senior Developer 
> *     Tel: 8 251 250
> *     Mobil: 091 64 26 36
> *     [EMAIL PROTECTED]
> ----------------------------------------------------------------------------
> ------------
> 

-- 

Markus Holmberg         |       Give me Unix or give me a typewriter.
[EMAIL PROTECTED]      |       http://www.freebsd.org/

Reply via email to