Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

oracle - How to fix “No Dialect mapping for JDBC type: -1” error in java

i'm getting one error how to resolve this error i.e,

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)

I'm trying to get XML column in that column data is in format of 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();

I'm getting error in List li = qu.list(); line.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For my case the type was missing, so setting qu.addEntity(MyBean.class); worked, in your case String.class might work


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...