简体   繁体   中英

org.hibernate.MappingException: No Dialect mapping for JDBC type: -1 , inner query fails

I am getting an exception on executing below MySQL query hibernate dialect used is org.hibernate.dialect.MySQLDialect following is my simple query.

String queryString= "select action,user_role ,action_desc , action_timestamp, action_done from event_details Where (general_type =1 or disco_type =1 or mask_type =1) and hadoop_type =0 AND COALESCE(source,'Structured') IN ('Both','Structured') and COALESCE(user_id,-1) =1 and Date(action_timestamp) between '2014-01-09' and '2014-04-09' ";

Query query = session.createSQLQuery(queryString); List list= query = query.list(); ...... This line throws exception.

when same query is executed for count ie select count(*) from (queryString ) t1; Then it gets executed fine.

Please suggest what could be the problem ? and how can solve it ??

将标量添加到查询后,问题已解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM