[hibernate-issues] [Hibernate-JIRA] Resolved: (ANN-549) key column of a true map should be not null when a join table is used

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Feb 9 22:51:47 EST 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-549?page=all ]
     
Emmanuel Bernard resolved ANN-549:
----------------------------------

    Resolution: Fixed

> key column of a true map should be not null when a join table is used
> ---------------------------------------------------------------------
>
>          Key: ANN-549
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-549
>      Project: Hibernate Annotations
>         Type: Bug

>   Components: binder
>     Versions: 3.2.1
>  Environment: H3.2
>     Reporter: Anthony Patricio
>     Assignee: Emmanuel Bernard
>      Fix For: 3.2.2
>  Attachments: MapNullableColumn_Annotation.zip, MapNullableColumn_Mappings.zip
>
>
> these metadatas should be considered as equivalent:
>     @org.hibernate.annotations.MapKeyManyToMany
>     @ManyToMany(cascade = CascadeType.ALL)
>     private Map<Security, Position> positions = new HashMap<Security, Position>();
> 	    <map name="positions" table="account_position" cascade="save-update">
> 	    	<key column="account_id" />
> 	    	<map-key-many-to-many class="Security" column="security_id"/>
> 	    	<many-to-many class="Position" column="position_id"/>
> 	    </map>
> But we can from the generated schema that they are not:
> -          annotation consider the map key as nullable column
> create table Account_Position (Account_id varchar(255) not null, positions_id bigint not null, mapkey_id varchar(255), primary key (Account_id, mapkey_id))
> -         whereas mapping files consider the map key as a not-nullable column   
> create table account_position (account_id varchar(255) not null, position_id bigint not null, security_id varchar(255) not null, primary key (account_id, security_id))
> Maybe there are more side effects.
> Attached are 2 testcases.

-- 
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




More information about the hibernate-issues mailing list