|
From: Benjamin B. (JIRA) <no...@at...> - 2006-06-25 20:59:33
|
Map<Entity, Entity> fails due to unique constraint on map-key column
---------------------------------------------------------------------
Key: ANN-379
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-379
Project: Hibernate Annotations
Type: Bug
Components: binder
Versions: 3.2.0.cr1
Environment: hibernate-3.2.0.CR2, hibernate-annotations-3.2.0.CR1, jdk-1.5.0_07
Reporter: Benjamin Bentmann
Attachments: IndexedCollectionTest.java
The current DDL statements for a true Map<Entity, Entity> produce a unique constraint on the map-key column. This effectively prevents multiple entities (hosting such a Map) from using the same map key.
I tracked the problem down to org.hibernate.cfg.annotations.MapBinder and its method bindKeyFromAssociationTable, line 225. In case of an entity as the map-key, the code always sets the unique flag for the join-column...
Attached is a slightly modified version of your own test case IndexedCollectionTest to reproduce the problem. The only change I made is located in the method testRealMap, adding just another Atmosphere with the same GasKey.
For a more verbose problem description you might want to have a look at:
http://forum.hibernate.org/viewtopic.php?t=961102
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|