[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-710) MapKeyManyToMany name attribute gets ignored
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Sat Mar 15 21:56:34 EDT 2008
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29813 ]
Emmanuel Bernard commented on ANN-710:
--------------------------------------
If it's an enum, it's not an entity so @MapKeyManyToMany is inappropriate.
Use @o.h.a.MapKey.columns
> MapKeyManyToMany name attribute gets ignored
> --------------------------------------------
>
> Key: ANN-710
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-710
> Project: Hibernate Annotations
> Issue Type: Bug
> Components: binder
> Affects Versions: 3.3.0.ga
> Environment: Hibernate 3.2.5
> PostgreSQL dialect
> Reporter: James Roper
>
> The following mapping:
> @CollectionOfElements
> @JoinTable(name = "my_join_table", joinColumns = @JoinColumn(name = "my_id"))
> @Column(name = "text")
> @Enumerated(EnumType.STRING)
> @MapKeyManyToMany(joinColumns = @JoinColumn(name = "my_enum"))
> private Map<MyEnum, String> text;
> Generates the following table:
> create table my_join_table (
> my_id int8 not null,
> text varchar(255),
> mapkey varchar(255),
> primary key (my_id, mapkey)
> );
> So, the "my_enum" column name is ignored, and "mapkey" is used instead. Note that the key for the map is an enum.
> Also, I don't see any way to set the length of a mapped column for String mapped enums.
--
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