Hi,
As Konstantin says, unless you want to get into container dependent issues, you
could specify a date as a parameter in your finder and then pass a Date, with
the current date, when calling it. It's not as simple as writing a simple SQL
sentence, but it works and it is DB and container portable. We also use it
because when you need to do some date arithmetic (p.e. whateverDate is 3 months
older than today) it is easier and more portable to do it in Java before calling
the finder. Besides, many containers don't allow date operations inside the
EJBQL, as it is out of the spec.
My 2ec,
D.

> --- Mick Knutson <[EMAIL PROTECTED]> wrote:
> > I have a query that I want to restrict the
> > Alert.startDate >= Today.
> > How can I do that with this query:
> > 
> >  * @ejb.finder   signature="java.util.Collection
> > findAllByUserId(
> > java.lang.Long pUserId )"
> >  *               query="SELECT OBJECT(c) FROM Alert
> > AS c WHERE c.userId =
> > ?1"
> >
> 
> Not exactly xdoclet question.... It really depensd on
> what app server you are using. And if EJBQL exposes
> today to you... Or maybe you 
> shall pass "today" value to the finder....
> And to watch whether to use java.util.Date or
> java,sql.Date...
> 
> regards,
> 
> =====
> ----[ Konstantin Pribluda ( ko5tik ) ]----------------
> Zu Verst�rkung meines Teams suche ich ab Sofort einen
> Softwareentwickler[In] f�r die Festanstellung. 
> Arbeitsort: Mainz 
> Skills:  Programieren, Kentnisse in OpenSource-Bereich
> ----[ http://www.pribluda.de ]------------------------
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user

--
This message was sent using Sake Mail, a web-based email tool from
Endymion Corporation.  http://www.endymion.com/products/sake
--- Mick Knutson <[EMAIL PROTECTED]> wrote:
> I have a query that I want to restrict the
> Alert.startDate >= Today.
> How can I do that with this query:
> 
>  * @ejb.finder   signature="java.util.Collection
> findAllByUserId(
> java.lang.Long pUserId )"
>  *               query="SELECT OBJECT(c) FROM Alert
> AS c WHERE c.userId =
> ?1"
>

Not exactly xdoclet question.... It really depensd on
what app server you are using. And if EJBQL exposes
today to you... Or maybe you 
shall pass "today" value to the finder....
And to watch whether to use java.util.Date or
java,sql.Date...

regards,

=====
----[ Konstantin Pribluda ( ko5tik ) ]----------------
Zu Verst�rkung meines Teams suche ich ab Sofort einen
Softwareentwickler[In] f�r die Festanstellung. 
Arbeitsort: Mainz 
Skills:  Programieren, Kentnisse in OpenSource-Bereich
----[ http://www.pribluda.de ]------------------------

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


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

Reply via email to