You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org> on 2007/06/13 13:52:28 UTC

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

Incorrect syntax generated for 'noMatch' exparessions when matched against objects with compound PK
---------------------------------------------------------------------------------------------------

                 Key: CAY-804
                 URL: https://issues.apache.org/cayenne/browse/CAY-804
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 1.2 [STABLE], 2.0 [STABLE], 3.0
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
            Priority: Minor
             Fix For: 3.0


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.