Grokbase Groups Cayenne dev June 2007
FAQ
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.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedJun 13, '07 at 11:53a
activeJun 13, '07 at 11:53a
posts1
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 1 post

People

Translate

site design / logo © 2022 Grokbase