The following issue has been updated:
Updater: Gavin King (mailto:ga...@in...)
Date: Mon, 18 Aug 2003 11:41 AM
Comment:
This is _certainly_ not a bug.
I don't understand the usecase. Why would you not just set both composite id coluumns to null? This seems to make no sense.
I mean, clearly, in a properly designed schema, foreign key constraints are enforced!
Anyway, a workaround would be to either fix your broken relational model of use a custom type. I am inclined to close this issue...
Changes:
type changed from Bug
priority changed from Major
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-267&page=history
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-267
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-267
Summary: ObjectNotFoundException is thrown instead of setting the object to null
Type: Improvement
Status: Unassigned
Priority: Minor
Project: Hibernate2
Components:
core
Assignee:
Reporter: abe zafar
Created: Sat, 16 Aug 2003 1:12 AM
Updated: Mon, 18 Aug 2003 11:41 AM
Environment: JDK1.4
Description:
Class A is associated with class B by a many-to-one relationship. Class B has a composite primary key which is composed of two columns, these two columns are used as foreign keys in class A.
Hiberate creates the composite key for class B from the values of these two columns, but when one of the column's value is null the composite key created will not refer to a row in table B. As a result Hibernate throws an ObjectNotFoundException.
I would have expected Hibernate to simply give a value of null for that instance of B instead of throwing the exception.
In a database schema where the foreign key constraints are enforced this would not be a problem, but when that constraint is not present it is definitely a problem.
Is there a workaround to this issue?
---------------------------------------------------------------------
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
|