Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-63
Here is an overview of the issue:
---------------------------------------------------------------------
Key: CAY-63
Summary: Support of toone relationships with FK target
Type: Improvement
Status: Assigned
Priority: Minor
Project: Cayenne
Components:
Cayenne Core Library
Fix Fors:
1.0 [STABLE]
Versions:
1.0 [STABLE]
1.1 [DEV]
Assignee: Andrus Adamchik
Reporter: Andrus Adamchik
Created: Wed, 17 Dec 2003 3:15 PM
Updated: Wed, 17 Dec 2003 3:15 PM
Description:
Cayenne is getting confused when a DB relationship is modeled as to-one with a target being an FK.
1. DbGenerator normally fails on such relationships, since it attempts to generate FK constraint that is not understood by the DB. E.g on PostgreSQL:
ALTER TABLE public.address ADD FOREIGN KEY (id) REFERENCES public.bill_account (bill_address_id) - ERROR: UNIQUE constraint matching given keys for refenced table "bill_account" not found.
2. Need to test how it handles object layer with such relationships.
As a short term solution in Cayenne we should detect these
relationships and do not try to generate an FK. As a long term solution
we may allow users to specify whether this is a true FK, and if so,
generate a unique constraint in addition to FK constraint. I will open
a bug for that, but it should not affect your immediate development.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://objectstyle.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
This archive was generated by hypermail 2.0.0 : Wed Dec 17 2003 - 15:17:18 EST