[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-4862) quoted column/alias names not properly handled in org.hibernate.loader.EntityAliases

Steve Ebersole (JIRA) noreply at atlassian.com
Thu Jan 28 16:38:29 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole updated HHH-4862:
--------------------------------

    Description: org.hibernate.loader.EntityAliases is used to define the aliases Hibernate will use to extract values out of result sets.  There are cases where it is given quoted names, which is does not handle at all.  It needs to strip off the quoting character before trying to pass it to the ResultSet.  (was: A quoted column name specified in @javax.persistence.ColumnResult is not properly handled during "type auto-detection" leading to errors like:

{noformat} 
org.hibernate.HibernateException: Could not resolve column name in result set [`INAME`]
	at org.hibernate.loader.custom.CustomLoader$Metadata.resolveColumnPosition(CustomLoader.java:567)
	at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:507)
	at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:526)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1836)
	at org.hibernate.loader.Loader.doQuery(Loader.java:714)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
	at org.hibernate.loader.Loader.doList(Loader.java:2249)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2146)
	at org.hibernate.loader.Loader.list(Loader.java:2141)
	at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:314)
	at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1832)
	at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
	at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:176)
	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:226)
{noformat} 
The underlying issue is that the quoted identifier is not wrapped in the dialect-specific quoting.  Here `INAME` should have become "INAME" or [INAME] etc depending on the dialect)
        Summary: quoted column/alias names not properly handled in org.hibernate.loader.EntityAliases  (was: column name quoting not properly handled for javax.persistence.ColumnResult)

> quoted column/alias names not properly handled in org.hibernate.loader.EntityAliases
> ------------------------------------------------------------------------------------
>
>                 Key: HHH-4862
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4862
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core, query-sql
>    Affects Versions: 3.5.0-Beta-3
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>             Fix For: 3.5.0-Beta-4
>
>          Time Spent: 1 hour, 8 minutes
>  Remaining Estimate: 0 minutes
>
> org.hibernate.loader.EntityAliases is used to define the aliases Hibernate will use to extract values out of result sets.  There are cases where it is given quoted names, which is does not handle at all.  It needs to strip off the quoting character before trying to pass it to the ResultSet.

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