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

William L Baker (JIRA) noreply at atlassian.com
Fri Jun 8 12:53:04 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27187 ] 

William L Baker commented on HBX-949:
-------------------------------------


Oops.  Toplink.

Not real sure what your answer means.  Steve Ebersole suggested that eventually the dialects should support a method of identifying keywords that needed backticks.  But I think that isn't there now.  I think you are suggesting the same thing.

Revenge might not be the best place to put this.  Steve was suggesting that the backtick checks could be put in hibernate core and the column name modified when the mapping file / annotations were loaded.  I hope I'm not putting words in his mouth.

bbaker


> 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
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> 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