我遇到一个错误如何解决此错误,即
org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:393)
我正在尝试获取XML列,因为该列数据采用XML格式
Session session = null;
session = getHibernateTemplate().getSessionFactory().openSession();
Query qu = session.createSQLQuery("select xml from details
where start_date between (select * from(select eventdate from emplyoeevent
where event='logout' and event_id in (select session_id from session
where session_emplyoee='"+Id+"') order by eventdate asc)
where rownum=1) and TO_DATE(SYSDATE, 'DD-MON-YYYY HH:MI:SS PM')");
List li = qu.list();
我在
List li = qu.list();
行中遇到错误。 最佳答案
就我而言,该类型丢失了,因此设置qu.addEntity(MyBean.class);工作,在您的情况下,String.class可能工作