You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Ari Maniatis (JIRA)" <ji...@apache.org> on 2010/01/06 12:48:55 UTC

[jira] Updated: (CAY-804) Incorrect syntax generated for 'noMatch' exparessions when matched against objects with compound PK

     [ https://issues.apache.org/jira/browse/CAY-804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ari Maniatis updated CAY-804:
-----------------------------

    Component/s: Core Library

> Incorrect syntax generated for 'noMatch' exparessions when matched against objects with compound PK
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CAY-804
>                 URL: https://issues.apache.org/jira/browse/CAY-804
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 1.2 branch, 2.0 branch, 3.0
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Minor
>             Fix For: Short term future
>
>
> Consider this unit test:
>        CompoundPkTestEntity t = (CompoundPkTestEntity) context.newObject(CompoundPkTestEntity.class);
>         t.setKey1("X");
>         t.setKey2("Y");
>         context.commitChanges();
>         
>         Expression e = ExpressionFactory.noMatchExp("toCompoundPk", t);
>         context.performQuery(new SelectQuery(CompoundFkTestEntity.class, e));
> The actual SQL generated is this:
>        SELECT t0.F_KEY1, t0.F_KEY2, t0.NAME, t0.PKEY FROM COMPOUND_FK_TEST t0 WHERE t0.F_KEY2 <> ? AND t0.F_KEY1 <> ? [bind: 'Y', 'X']
> While it should be this (OR instead of AND)
>        SELECT t0.F_KEY1, t0.F_KEY2, t0.NAME, t0.PKEY FROM COMPOUND_FK_TEST t0 WHERE t0.F_KEY2 <> ? OR t0.F_KEY1 <> ? [bind: 'Y', 'X']

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