hi there,
spring 1.0.1
hibernate 2.1.2
firebird1.0
hibernate.dialect = net.sf.hibernate.dialect.FirebirdDialect
why does hibernate generate a CASE clause in SELECT when using FirebirdDialect like this (an excerpt):
select col1,
case when ... then 0 when ... then 1 when ... then 2 end as clazz_, ...
from MyTable ac0_
....
Firebird 1.0 does not understand CASE.
This is log:
2004-06-03 15:35:36,382 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Exception>
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 35
when
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:91)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:34)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:682)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:232)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.Loader.list(Loader.java:940)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at org.springframework.orm.hibernate.HibernateTemplate$13.doInHibernate(HibernateTemplate.java:423)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:147)
at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:382)
at org.springframework.orm.hibernate.HibernateTemplate.find(HibernateTemplate.java:419)
.............................
Thanks,
Sergei.
|