[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3379) Dialect support for SQL comments

Mathias Bogaert (JIRA) noreply at atlassian.com
Tue Sep 9 08:14:04 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31110#action_31110 ] 

Mathias Bogaert commented on HHH-3379:
--------------------------------------

Same issue for DB2 8.1 on Z/OS. Please fix this asap.

> Dialect support for SQL comments
> --------------------------------
>
>                 Key: HHH-3379
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3379
>             Project: Hibernate3
>          Issue Type: Patch
>    Affects Versions: 3.2.6
>         Environment: Hibernate 3.2.6.ga, Informix 7.31
>            Reporter: Daniel Bell
>         Attachments: hibernate.dialect.patch
>
>
> I have recently tried turning on SQL comments in hibernate 3.2.6.ga.
> However, I found that our database (informix 7.31) did not support SQL
> where the comment was at the start of the comment. Instead, the comment
> needed to be after the SQL. For example:
> /* not accepted by informix 7.31*/ select * from systables;
> select * from systables /* accepted by informix 7.31*/
> Because of this, I have added a method to the Dialect for adding comments:
>    /**
>     * Add a comment to the SQL string.
>     *
>     * @param sql          StringBuffer holding the SQL.
>     * @param comment      Comment to add to the SQL. May be null.
>     */
>    public void addCommentToSql(StringBuffer sql, String comment) {
>        if (StringHelper.isNotEmpty(comment))
>            sql.insert(0, "/* " + comment + " */ ");
>    }
> Thus, the default implementation provides the same functionality as
> before. However, derived Dialects may override this method to add the
> comment in a different location.
> It is also possible to add additional comments in the derived Dialect.
> In our case, we also add the Java thread ID. 

-- 
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