[jboss-jira] [JBoss JIRA] (HIBERNATE-54) problems w/ column names beginning with '_' (underscore) w/ apache derby database
Steve Ebersole (JIRA)
issues at jboss.org
Thu Nov 19 10:29:01 EST 2015
[ https://issues.jboss.org/browse/HIBERNATE-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130910#comment-13130910 ]
Steve Ebersole commented on HIBERNATE-54:
-----------------------------------------
This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.
Also the subject is completely inaccurate given the rest of the description. The columns do not start with an underscore...
> problems w/ column names beginning with '_' (underscore) w/ apache derby database
> ---------------------------------------------------------------------------------
>
> Key: HIBERNATE-54
> URL: https://issues.jboss.org/browse/HIBERNATE-54
> Project: Hibernate Integration
> Issue Type: Bug
> Environment: windows xp, java 1.5.0_09, eclispe 3.2.1, hibernate 3.2.1, derby 10.2.2.0, hibernate tools 3.2 beta8
> Reporter: bugra uytun
> Assignee: Steve Ebersole
>
> derby has problems with column names beginning with underscore, see also http://db.apache.org/derby/docs/10.1/ref/crefsqlj1003454.html
> therefore such column names should be between double quotation marks (notice that double quotation marks also sets the case sensitivity on column names.)
> but hibernate translates a HQL statement like this "from table1 t where t.id = '1'" to something like:
> select table1_.id as id4, table1_._colname1 as column27_4_ schema1.table1 table1_ where table1_.id = '1'
> but because of the columns that are beginning with an underscore the translation should be:
> select table1_."id" as id4, table1_."_colname1" as column27_4_ schema1."table1" table1_ where table1_."id" = '1'
> the errors i got are:
> DEBUG [JDBCExceptionReporter]: could not execute query [<translated sql statement>]
> ERROR 42X01: Syntax error: Encountered "_" at line 1, column 987.
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
> at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
> at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
> at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
> at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
> at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
> at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
> at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
> at org.hibernate.loader.Loader.doQuery(Loader.java:661)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
> at org.hibernate.loader.Loader.doList(Loader.java:2211)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
> at org.hibernate.loader.Loader.list(Loader.java:2090)
> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
> at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
> at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
> at <mypackage>.MyHibernate.main(MyHibernate.java:13)
> WARN main org.hibernate.util.JDBCExceptionReporter - SQL Error: 20000, SQLState: 42X01
> ERROR main org.hibernate.util.JDBCExceptionReporter - Syntax error: Encountered "_" at line 1, column 987.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list