Hi Zvonomir,
It will be easier to comment on your problem if you could post the
actual expression, i.e. the output of Expression.toString(). Also
what Java class is "visibleFrom" - java.util.Data, sql.Timestamp,
sql.Date?
Andrus
On Nov 5, 2005, at 5:49 PM, Zvonimir Spajic wrote:
> Hello,
>
> it seems that there is a different behaviour for the same Expression
> a) executed on a database
> b) executed on an exisiting DataObject.
>
>
> I use MySql 4.1 and Cayenne with Manifest data:
>
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.6.5
> Created-By: 1.4.2_09-b05 (Sun Microsystems Inc.)
> Built-By: andrus
> Extension-Name: org.objectstyle.cayenne
> Specification-Version: cayenne
> Specification-Vendor: ObjectStyle.org
> Implementation-Vendor-Id: org.objectstyle
> Implementation-Version: 1.1.3
> Implementation-Vendor: ObjectStyle.org
>
>
>
> The scenario:
>
> 1) I need a value as criteria that identifies new ProductMedia
>
> Date aDate = Util.getDefaultDateForNewProductMedia();
> long timeLimit = aDate.getTime();
>
> (timeLimit is in this example a long value '1128602518890' (-->
> 06.10.2005 14:41))
>
>
> 2) The value in the database of the column 'visibleFrom' is 2005-10-06
>
> 3) Dependent on greaterOrEqual value of a date column (MySql type
> 'date') I get a objectList from the database.
> ...
> Expression qualNew = ProductMedia.getNewExpression
> (System.currentTimeMillis(), timeLimit);
> List aNewObjectsList = ProductMedia.getProductMediaForExpression
> (ctxt, qualNew);
> ...
> ...
> and I get this object from db, where the visibleFrom value is
> '2005-10-06'
>
> 4) But If I invoke the same Expression on the DataObject, that is
> read before, it returns false.
>
> if(qualNew.match(aProductMedia)) { --> returns false
>
>
>
> Thanks for any help...
This archive was generated by hypermail 2.0.0 : Mon Nov 07 2005 - 00:49:29 EST