日期:2014-05-18 浏览次数:20631 次
public static void main(String[] args) {
Session session=HibernateSessionFactory.getSessionFactory().getCurrentSession();
Transaction tx=session.beginTransaction();
String hql1="select s.*,p.* from jxj_PrizeInfo p,t_main s where p.studentID=s.xh";
List<Object[]> objs=session.createSQLQuery(hql1).list();
tx.commit();
}
Exception in thread "main" org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
at org.hibernate.dialect.TypeNames.get(TypeNames.java:76)
at org.hibernate.dialect.TypeNames.get(TypeNames.java:99)
at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:592)
package com.xin.action;
import java.sql.Types;
import org.hibernate.Hibernate;
import org.hibernate.dialect.SQLServerDialect;
public class ZdySQLSserverDialect extends SQLServerDialect{
public ZdySQLSserverDialect() {
super();
registerHibernateType(Types.NVARCHAR, Hibernate.STRING.getName());
}
}