[ 
https://issues.apache.org/cayenne/browse/CAY-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12950#action_12950
 ] 

Lachlan Deck commented on CAY-1073:
-----------------------------------

Comments from CAY-1072: Andrus wrote:
----
Yes, converting dates to Strings are a no-go. I don't see us being able to fix 
that on the short run. Could you try a parameterized expression instead (using 
$param instead of date literals).
On the other hand, we need some way to handle dates or other parameters that 
can't be converted into literals... I guess one way is to generate "synthetic" 
parameters and collect values in a map passed as an argument.
----

The problem is that I can't use parameter based expressions as they are 
constructed elsewhere (as instances of Expression) and re-used in various 
places (including in-memory).

Is it not possible to re-use whatever code in Cayenne already converts such 
values (depending on the associated DbAttribute, for example)?

> Bug in Expression.toEJBQL with inExp/notInExp
> ---------------------------------------------
>
>                 Key: CAY-1073
>                 URL: https://issues.apache.org/cayenne/browse/CAY-1073
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: Linux, ubuntu 8.04
>            Reporter: Laurent Marchal
>            Assignee: Andrus Adamchik
>             Fix For: 3.0
>
>
> There is a bug transforming and expression containing an inExp/notInExp into 
> EJBQL :
> I create a expression filtering departments :
>               List<Short> departmentIds = new 
> ArrayList<Short>(_departmentList.size());
>               for (Department department : _departmentList) {
>                       departmentIds.add(department.getDepartmentId());
>               }
>               
>               return 
> ExpressionFactory.notInExp(DailyJob.DEPARTMENT_ID_PROPERTY, departmentIds);
> --->  "SMASTER.DEPTID not in (1, 2)"
> Then i transform it to EJBQL with Expression.toEJBQL("a")
> --->  "a.departmentId not in ()"
> The IN clause is empty.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to