Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-364
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-364
Summary: One to One foreign Key issue
Type: Bug
Status: Unassigned
Priority: Major
Project: Hibernate2
Versions:
2.0.3
Assignee:
Reporter: Jon King
Created: Thu, 25 Sep 2003 10:09 PM
Updated: Thu, 25 Sep 2003 10:09 PM
Environment: Windows 2000, Ant 1.5.4, Oracle 8i, Java 1.4
Description:
I have a PURCHASE ORDER with a one to one relationship with a BUYER and SUPPLIER, I have set it up so the PK of the Purchase Order is the FK of the BUYER & SELLER tables but only the last one-to-one foreign key is ever created.
<class name="domain.TxPurchaseOrder" table="TX_PURCHASE_ORDER">
....
<id column="PO_ID" name="id" type="long" unsaved-value="null">
<generator class="sequence" >
<param name="sequence">TX_PURCHASE_ORDER_SEQ</param>
</generator>
</id>
<one-to-one name="SellingParty"
class="domain.TxPoSellingParty"
cascade="all"
constrained="true" />
<one-to-one name="BuyingParty"
class="domain.TxPoBuyingParty"
cascade="all"
constrained="true"/>
...
</class>
In the Selling and Buying classes I have :-
<id column="PO_ID" name="id" type="long" unsaved-value="null">
<generator class="foreign" />
</id>
In the output I get: -
[java] alter table TX_PURCHASE_ORDER add constraint FK8092ED8B48CAF5B foreign key (PO_ID) references TX_PO_BUYING_PARTY
but the Selling Party does not get a foreign key.
I would have expected both to get a foreign key contraint, have I done something wrong or is this correct ?
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|