You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Vandahl (JIRA)" <ji...@apache.org> on 2006/11/26 19:25:20 UTC
[jira] Closed: (TORQUE-42) Criteria.andDate missing getTime()
method call
[ http://issues.apache.org/jira/browse/TORQUE-42?page=all ]
Thomas Vandahl closed TORQUE-42.
--------------------------------
> Criteria.andDate missing getTime() method call
> ----------------------------------------------
>
> Key: TORQUE-42
> URL: http://issues.apache.org/jira/browse/TORQUE-42
> Project: Torque
> Issue Type: Bug
> Components: Runtime
> Affects Versions: 3.2
> Environment: java5, tomcat 5.5.17
> Reporter: Federico Fissore
> Assigned To: Thomas Vandahl
> Fix For: 3.3
>
> Attachments: Criteria-3.2.patch
>
>
> Hello all,
> there is a bug in Criteria.andDate: the call to the method getTime() is missing while it is present in Criteria.addDate
> To exploit it use a code like
> calendar.setTime(new Date());
> crit.addDate(GpsLocationPeer.LAST_UPDATE, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), Criteria.GREATER_EQUAL);
> calendar.add(Calendar.DAY_OF_MONTH, 1);
> crit.andDate(GpsLocationPeer.LAST_UPDATE, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), Criteria.LESS_THAN);
> This leads to a SQLException due to incorrect sql query creation.
> That is easy to see with Criteria.toString()
> Adding the missing method call solves the problem
> Please, check the attached patch. Thank you
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org