Hibernate : No Dialect mapping for JDBC type: 101
Try it like this:
Object result = session.createSQLQuery(
"SELECT " +
" rownum as id, " +
" mm.metric_name, " +
" dm.aggregated_value_float, " +
" dm.created_timestamp as dm_timestamp, " +
" s.type, " +
" s.name as subelement_name " +
"FROM " +
" daily_metric dm, " +
" subelement s, " +
" metric_metadata mm " +
"WHERE " +
" dm.subelement_id =s.subelement_id AND " +
" TRUNC(dm.created_timestamp)='15-JAN-15' AND " +
" s.subelement_id =1456376 AND " +
" dm.metric_metadata_id = mm.metric_metadata_id " +
"ORDER BY 1,2 DESC")
.addScalar("dm_timestamp", TimestampType.INSTANCE)
.uniqueResult();
MappingException: No Dialect mapping for JDBC type: 2002
I solved given problem with .addEntity(Webpage.class)
:
hqlQuery = sessionFactory
.getCurrentSession()
.createSQLQuery(buildSearchQuery())
.addEntity(Webpage.class);
Spring Hibernate: No Dialect mapping for JDBC type: -101
Well, I found the problem.
The error message it gives seems misleading to me, as it doesn't match what the solution is.
I needed to provide the createNativeQuery
function with a .class
to cast the results too.
em.createNativeQuery(<query>, PTags.class)
fixed the issue
JPA - No Dialect mapping for JDBC type: 1111 when calling a postgresql function with varchar
It seems Hibernate is not happy about the function returning VOID, so changing it to return INT and just calling RETURN 1 at the end solved the problem.
Related Topics
Java - Scroll to Specific Text Inside Jtextarea
How to Exit a While Loop in Java
Main Method Not Found Even If I'Ve Declared It
Java How Expensive Is a Method Call
How to Search in a List of Java Object
Make Simpledateformat.Parse() Fail on Invalid Dates (E.G. Month Is Greater Than 12)
Spark Spark-Submit --Jars Arguments Wants Comma List, How to Declare a Directory of Jars
Java Converting Int to Hex and Back Again
Turning an Executorservice to Daemon in Java
Java Key Listener in Commandline
Do We Need Volatile When Implementing Singleton Using Double-Check Locking