You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2009/12/24 13:32:29 UTC
[jira] Created: (CAY-1348) Allow to-many relationships from non-pk
columns
Allow to-many relationships from non-pk columns
-----------------------------------------------
Key: CAY-1348
URL: https://issues.apache.org/jira/browse/CAY-1348
Project: Cayenne
Issue Type: Improvement
Components: Cayenne Core Library
Affects Versions: 3.1M1
Reporter: Andrus Adamchik
Assignee: Andrus Adamchik
Priority: Minor
This is something that came up in my work, and the feature is about allowing Cayenne to handle some really loose schemas. Consider 2 tables:
t1 ( pk1, pk2, c1)
t2 ( pk, fk_c1, fk_pk2)
t1 has PK defined as (pk1,pk2), at the same time (pk2, c1) also uniquely identifies each row. A relationship t2 join t1 on (t2.fk_c1 = t1.c1 and t2.fk_pk2 = t1.pk2) doesn't work. When 1..N part is resolved, a query like this is generated:
SELECT t2.* FROM t2 WHERE t2.fk_c1 = NULL AND t2.fk_pk2 = ? [bind: 1->fk_pk2:'correct_value']
This is not super high priority, but I think we should support such fuzzy relationships. Cayenne traditionally had strong support for various legacy schemas. So we should support this case as well.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.