[hibernate-issues] [Hibernate-JIRA] Created: (HBX-949) Column names in generated SQL should be surrounded by the backtick character

William L Baker (JIRA) noreply at atlassian.com
Thu Jun 7 16:52:04 EDT 2007


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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list