[hibernate-issues] [Hibernate-JIRA] Closed: (ANN-369) @CollectionOfElements on a Map uses reserved word "key" as column name

Martin (JIRA) noreply at atlassian.com
Wed May 6 12:29:14 EDT 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin closed ANN-369.
----------------------


> @CollectionOfElements on a Map uses reserved word "key" as column name
> ----------------------------------------------------------------------
>
>                 Key: ANN-369
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-369
>             Project: Hibernate Annotations
>          Issue Type: Bug
>          Components: binder
>    Affects Versions: 3.2.0.cr1
>         Environment: Hibernate 3.2.0cr1, MySQL 5
>            Reporter: Martin
>            Assignee: Emmanuel Bernard
>             Fix For: 3.2.0.cr2
>
>         Attachments: dont_use_key_for_maps.diff
>
>
> This annotation
> [User.java]
> @CollectionOfElements
> public Map<String, String> getMisc()
> results in this create table statement:
> create table User_misc (User_id bigint not null, element varchar(255), key varchar(255), primary key (User_id, key)) type=InnoDB
> But "KEY" is a reserved word, so MySQL won't create that table. The default column name should either change or be enclosed by backticks.

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