Im getting grey hair....
Hibernate version: 3.0
Hi, I have a problem using a simple createSQLQuery method in a dao class that extendes HibernateDaoSupport.
I can see its complaining about my id column in my Ad class. the id variable is a String as you can see in my hib-mapping doc below but this should not be a problem....
The code looks like this:
return getSession().createSQLQuery("select * from ad")
.addEntity("ad", Ad.class)
.list();
the exception show:
Hibernate: select * from ad
2006-02-01 22:31:51,509 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL E
rror: 0, SQLState: S0022>
2006-02-01 22:31:51,509 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Colu
mn 'id0_' not found.>
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificExceptio
n(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter
.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1596)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:112)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1414)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:153)
at com.buysell.server.dao.hibernate.AdDaoHibernate.executeSql(Unknown So
urce)
at com.buysell.client.service.AdServiceImpl.executeSql(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
My mapping document
<id
name="id"
column="id"
type="java.lang.String"
length="32"
unsaved-value="null"
>
<generator class="uuid.hex">
</generator>
</id>
_________________ kmike
|