From: <leg...@at...> - 2003-12-08 11:54:41
|
The following comment has been added to this issue: Author: Hunter Kelly Created: Mon, 8 Dec 2003 5:53 AM Body: I've just tested this in Hibernate-2.0.3 and it works. Something that works in one major release, and not in the next, is definately a bug. I actually first came across the issue last week when doing the upgrade from 2.0.3 to 2.1rc1. I don't mean to sound tetchy, I'm just trying to be helpful. I work on a real commercial product, and Hibernate has enabled us to do a tremendous amount in a very short period of time - I think it is, hands down, one of the best pieces of software that I've used. If there is something else I can do to help sort this out, please let me know. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-531 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-531 Summary: One-To-One mappings with int/native ids don't work properly Type: Bug Status: Closed Priority: Critical Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 final 2.1 rc1 Assignee: Reporter: Hunter Kelly Created: Mon, 8 Dec 2003 4:49 AM Updated: Mon, 8 Dec 2003 5:53 AM Environment: RedHat Linux 9.0 MySQL 4.0.14-standard Latest Hibernate CVS tree Description: I have a one to one mapping in a class, Thing, that maps to IntThing and UUIDThing. IntThing and UUIDThing both define a many-to-one mapping back to Thing. Int thing uses "native" generator for id. UUID uses "uuid.hex" generator for id. I would have thought they'd behave the same, but they don't. I've built a truth table for each, where I changed the values of the "constrained" attribute on the one-to-one mapping and the "not-null" attribute on the many-to-one mapping. For UUID thing: Constrained = true | Constrained = false ------------------------------------------------------- Not-Null | | true | failed | sucess ------------------------------------------------------- Not-Null | false | success | success ------------------------------------------------------- For Int thing: Constrained = true | Constrained = false ------------------------------------------------------- Not-Null| | true | failed | failed ------------------------------------------------------- Not-Null| | false | success | failed ------------------------------------------------------- The above chart shows that regardless of what constrained is set to, you can't have a one-to-one mapping to an entity with an int id type that has a not-null constraint back to the parent. I'll attach the files now - to compile and run I just made a copy of the "eg" target in Hibernate's build.xml, uncommented the lines in hibernate.properties relevant to MySQL and changed the database name. --------------------------------------------------------------------- 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 |