I'm trying to use hibernate to return data from multiple tables from my database. The query works fine on my SQL server, however it does not seem to work with hibernate's
createSQLQuery.
CodeCode:
Query threadQuery = session.createSQLQuery("SELECT CONCAT(t.lastposter) as lastposter, t.lastpost, t.title, t.threadid, t.lastpostid, t.firstpostid, t.forumid, p.pagetext FROM vbulletin.thread AS t INNER JOIN vbulletin.post AS p ON p.postid = t.firstpostid WHERE t.open != 10 AND t.visible = 1 AND t.forumid != 19 AND t.forumid != 20 ORDER BY t.lastpost DESC").setResultTransformer(Transformers.aliasToBean(VbulletinThread.class));
ExceptionCode:
org.springframework.orm.hibernate3.HibernateSystemException: No Dialect mapping for JDBC type: -1; nested exception is org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
at...
The aliases match the fields of my class.
Note: it works fine when I remove p.pagetext from the query.I don't see the problem, maybe you guys can help?