Yes. Using JBoss declared SQL, you basically override
the SQL defined in the ejb.select.

An example from our code:

 *  @ejb.finder
 *      method-intf="LocalHome"
 *      signature="Collection
findMaxEventForClient(int clientId)"
 *      query="SELECT OBJECT(e) FROM Event where
e.clientId = ?1"
 *      result-type-mapping="Local"
 [EMAIL PROTECTED]
 *      method-intf="LocalHome"
 *      signature="Collection
findMaxEventForClient(int clientId)"
 *      from=""
 *      where="event_id = (select max(event_id) from
client c,  event e where c.client_id = e.client_id and
c.client_id = {0})"
 *      order=""
 *      alias="e"
 *      strategy="on-load"
 *      page-size=1
 *      eager-load-group="default"
 *

//Nicholas


--- Matthew Hixson <[EMAIL PROTECTED]> wrote:
> I was just wondering if its possible to make use of
> JBossQL in an 
> ejbSelect method.  We've gone to the trouble of
> extending JBossQL to 
> include now(), but I'd like to make use of it from
> within an ejbSelect 
> method.
> 
>    /**
>     * @ejb.select
>     *     result-type-mapping="Local"
>     *     query="select o.contentId from v_content o
>        *     where o.contract.contractId = ?1
>        *     and o.availableStartDate is not NULL
>        *     and o.availableEndDate is not NULL
>        *     and o.contract.startDate is not NULL
>        *     and o.contract.endDate is not NULL
>        *     and o.approvalCode = 97
>        *     and now() > o.availableStartDate and
>        *     now() < o.availableEndDate
>        *     and now() > o.contract.startDate and
>        *               now() < o.contract.endDate
>        *     order by o.availableStartDate desc"
>     *
>     * @param contractId
>     * @return Collection
>     * @throws FinderException
>     */
>    public abstract Collection 
> ejbSelectAvailableContentIdsByContractId(Integer
> contractId) throws 
> FinderException;
> 
> Is is possible to add an xdoclet tag to make that
> ejbSelect method use 
> JBoss-QL rather than EJB-QL?
>    We're using xdoclet 1.2b3.
>    Thanks,
>      -M@
> 
> 
> 
>
-------------------------------------------------------
> 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


=====
Nicholas Whitehead
Home: (973) 377 9335
Cell: (201) 615 2716
[EMAIL PROTECTED]
Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/


-------------------------------------------------------
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