We got the following problem,
We have tables names that are reserved keywords in MySQL, like Group and Match.
Hibernate generates sql like this:
Code:
insert into Group (name) values ('bla')
We would like it to be:
Code:
insert into `Group` (`name`) values ('bla')
Default solution to this problem is add the ` to the specific table name and column name in the mapping file.
We use annotations so this solution does not apply. You cannot add ` to the @Table annotation.
An other solution would be to use other non-reserved names, but quoting should be an option in my opinion
The next solution would be to extend the MySql dialect to always provide the quotes. We are about to do this.
It would be nice to see an option to enable quoting for any dialect. So that you wouldn't need 2 versions of every dialect.
Your input on this issue would be appreciated
Hibernate version:
3.1.3 (all)
Mapping documents:
not used, using annotations