Message:
The following issue has been re-assigned.
Assignee: Steve Ebersole (mailto:ste...@vi...)
Assigner: Gavin King (mailto:ga...@hi...)
Date: Wed, 26 Nov 2003 10:00 AM
Comment:
Steve, take a look at this if you get a chance, otherwise assign back to me. Probably need to handle this inside the Alias class.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-499
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-499
Summary: Wrong alias with a class with $s name
Type: Bug
Status: Open
Priority: Minor
Project: Hibernate2
Components:
core
Versions:
2.1 beta 6
Assignee: Steve Ebersole
Reporter: Alfonso da Silva
Created: Tue, 25 Nov 2003 9:59 AM
Updated: Wed, 26 Nov 2003 10:00 AM
Environment: Hibernate 2.1 beta 6, PostgreSQL 7.2
Description:
I have a class (generated with gclib) with this name:
persistent.core.DAO$$EnhancedByCGLIB$$0
When I want to load an object, Hibernate generates this SQL sentence:
select dao$$enh0_.IDO as IDO0_, dao$$enh0_.nom as nom0_, dao$$enh0_.edat as edat0_ from alumne1 dao$$enh0_ where dao$$enh0_.IDO=?
and the JDBC driver crashes:
java.sql.SQLException: ERROR: parser: parse error at or near "$$"
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
at org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:83)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:631)
at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:166)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:111)
I think that the class alias generation would have to replace '$' by '_' (or another inoffensive character ;) ).
The class alias generation takes place in net.sf.hibernate.loader.OuterJoinLoader (lines 517-528) and uses net.sf.hibernate.sql.Alias.
Thankx.
Kutlax.
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|