[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5005) Column name not prefixed with table name alias

Jeremy Hindmarsh (JIRA) noreply at atlassian.com
Tue May 18 20:35:11 EDT 2010


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

Jeremy Hindmarsh commented on HHH-5005:
---------------------------------------

Yes I tried putting backticks around the column name.  This causes the table name alias to be appended to the column name but puts doubles quotes around the column name as well.

select geoentity0_.EXPIRY_DATE as EXPIRY16_5_0_, geoentity0_."GEOM.SDO_POINT.Y" as GEOM17_5_0_, geoentity0_."GEOM.SDO_POINT.X" as GEOM18_5_0_, geoentity0_.PARENT as PARENT5_0_, geoentity0_.QABY as QABY5_0_, geoentity0_.QADATE as QADATE5_0_ from ENTITIES geoentity0_ where geoentity0_.ENO=?

This causes the same invalid identifier exception:

java.sql.SQLException: ORA-00904: "GEOENTITY0_"."GEOM.SDO_POINT.X": invalid identifier

> Column name not prefixed with table name alias
> ----------------------------------------------
>
>                 Key: HHH-5005
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5005
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations
>    Affects Versions: 3.5.0-CR-2
>         Environment: Hibernate 3.5 CR2, Oracle 10g
>            Reporter: Jeremy Hindmarsh
>            Assignee: Gail Badner
>
> If a column name annotation contains a full stop, the column name is not prefixed with the table name alias.
> Some of our database tables contain Oracle spatial data. One in particular has two columns for longitude and latitude,
> GEOM.SDO_POINT.X and GEOM.SDO_POINT.Y
> The problem is that the table alias is not added to the column name due to isIdentifier method in the Template class.
> This method returns false because the column name contains full stops.
> This means the renderWhereStringTemplate method doesn't prefix the column name with the table alias placeholder.
> Fortunately for now I can use the following column definition, in order to get the table alias added.
> @Column(name = "$PlaceHolder$.GEOM.SDO_POINT.X")

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