[jira] Commented: (CAY-1073) Bug in Expression.toEJBQL with inExp/notInExp

From: Lachlan Deck (JIRA) ("Lachlan)
Date: Tue Jun 10 2008 - 08:08:52 EDT

  • Next message: Michael Gentry: "Re: Apache Board Report (June)"

        [ 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.



    This archive was generated by hypermail 2.0.0 : Tue Jun 10 2008 - 08:09:39 EDT