use Date values in ExpressionFactory.exp

Andrea Biasillo <[email protected]>
Newsgroups gmane.comp.java.cayenne.user
Message-ID <pony-eb26d4b97ed24d27e0f8f8afa0aa2a0ef7145fb7-b656cce938e7446a0313282160194031bd51099a@user.cayenne.apache.org>
Hi!

Is it possible to use Date values in ExpressionFactory.exp?

This works very well:

Expression exp = ExpressionFactory.exp("businessPartnerName='andrea' and businessPartnerCode!='rossi' or ((businessPartnerCode!='bianchi' and maxAdvancePaymentPercent>9) or businessPartnerCode!='pippo' or (maxAdvancePaymentPercent>100 or maxAdvancePaymentPercent<10))");

but if I use a Date value like this:

Expression expDate = ExpressionFactory.exp("modifiedDate> '2003-07-17'");

The database, Oracle in my case, will complain:

Literal does not match format string 
(the database expects something like this:  MODIFIED_DATE > DATE '2003-07-17')

Any input?

Andrea
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.