This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am executing a native SQL query in JPA. No entities involved
The problem i am facing is when the query string is projecting a column of type TEXT in db, the code throws an exception
javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
The same query works if i change the datatype of the column to VARCHAR. Is there a limitation of JPA with TEXT or is the problem altogether different.
I am having exactly the same problem. I am using org.hibernate.dialect.MySQL5InnoDBDialect.
The "config" column type MEDIUMTEXT. As you can see I'm trying to cast the result simply as a String.
Any idea on how to work around the problem?
Joined: May 27, 2010
I spent a couple of hours on this and moved on. Here's a few alternatives. Try using hibernate's implementation of the API. Or else use simple jdbc metadata. Both will mean a significant change in code. The simplest solution is change the column type in the database. Unfortunately, I had to write jdbc code as I didnt receive approval for schema modification. Hope someone sorts this out.