Column names in generated SQL should be surrounded by the backtick character
----------------------------------------------------------------------------
Key: HBX-949
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-949
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2beta9
Environment: Any
Reporter: William L Baker
Orinally opened as HH-2660 for Hibernate Core, and rejected since it can be specified at
the mapping (annotation) level. Revenge should thus put the backticks in the mapping
file.
The original description follows:
Column names in generated SQL statements should be surrounded by the backtick character.
This is necessary for column names that conflict with reserved words or functions. It is
easily demonstrated by creating a table with a column name DIV and a column name GROUP.
Hibernate currently generates invalid sql statements for accessing this table.
"select DIV, GROUP from NEWTABLE" gives a syntax error. "select `DIV`,
`GROUP` from NEWTABLE works as expected. It is only necessary to change two lines of code
to fix this behavior.
Though this is supposed to work, it might causes some side effects. I tested a patch at
the Core level, but have not tested revised annotations.
Don't know how other mapping tools behave such as tophat.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira