From: Martin (JIRA) <no...@at...> - 2006-06-12 13:30:41
|
@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 Type: Bug Components: binder Versions: 3.2.0.cr1 Environment: Hibernate 3.2.0cr1, MySQL 5 Reporter: Martin 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 |
From: Tristan T. (JIRA) <no...@at...> - 2006-06-27 15:48:00
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=all ] Tristan Tarrant updated ANN-369: -------------------------------- Attachment: dont_use_key_for_maps.diff Patch for Annotations which changes "key" to "mapkey". This bug causes problems with MySQL and SQLServer > @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 > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0cr1, MySQL 5 > Reporter: Martin > 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 |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-27 17:19:02
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=all ] Emmanuel Bernard reassigned ANN-369: ------------------------------------ Assign To: Emmanuel Bernard > @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 > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0cr1, MySQL 5 > Reporter: Martin > Assignee: Emmanuel Bernard > 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 |
From: Ashley C. (JIRA) <no...@at...> - 2006-07-06 15:28:02
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=comments#action_23552 ] Ashley Collins commented on ANN-369: ------------------------------------ This is also an issue for Derby DB http://forum.hibernate.org/viewtopic.php?t=959861 Thanks. Ashley > @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 > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0cr1, MySQL 5 > Reporter: Martin > Assignee: Emmanuel Bernard > 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 |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-06 15:31:57
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=comments#action_23553 ] Emmanuel Bernard commented on ANN-369: -------------------------------------- Year, Everything is an issue for Derby. ( Sorry, couldn't resist ;-) ) > @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 > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0cr1, MySQL 5 > Reporter: Martin > Assignee: Emmanuel Bernard > 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 |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-07 13:18:58
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=comments#action_23570 ] Emmanuel Bernard commented on ANN-369: -------------------------------------- Seems not to be clear to everyone, but you can set the column name through @org.hibernate.annotations.MapKey > @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 > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0cr1, MySQL 5 > Reporter: Martin > Assignee: Emmanuel Bernard > 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 |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-27 11:02:46
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-369?page=all ] Emmanuel Bernard updated ANN-369: --------------------------------- Fix Version: 3.2.0 > @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 > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0cr1, MySQL 5 > Reporter: Martin > Assignee: Emmanuel Bernard > Fix For: 3.2.0 > 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 |