这是我Mapper.XML里的写查询SQL
<select id="findGroup" resultMap="GroupResult" flushCache="false" useCache="true">
    <![CDATA[
   select * from CS_GROUP
    ]]>
</select>在dao中写的
public Group findGroup()
  {
    return (Group)this.getSqlSessionTemplate().selectList ( "com.wonders.common.security.model.LoginUserInfo.findGroup");
   }我测试时候写的
@Test
public void findGroup()
{
   System.out.println("+++++findGroup+++++");
   Group entity=new Group();
   entity=dao.findGroup();
   System.out.println(entity.getDESCRIPTION());

}
当我JUnit的时候
<Unable to translate SQLException with Error code '17026', will now try the fallback translator><After test method: context [[TestContext@56a499 testClass = LoginUserInfoDaoTest, locations = array<String>['classpath*:spring/*.xml'], testInstance = com.wonders.common.security.dao.LoginUserInfoDaoTest@506411, testMethod = findGroup@LoginUserInfoDaoTest, testException = org.springframework.jdbc.UncategorizedSQLException: SqlSession operation; uncategorized SQLException for SQL []; SQL state [null]; error code [17026]; 数字溢出; nested exception is java.sql.SQLException: 数字溢出]], class dirties context [false], class mode [null], method dirties context [false].><After test class: context [[TestContext@56a499 testClass = LoginUserInfoDaoTest, locations = array<String>['classpath*:spring/*.xml'], testInstance = [null], testMethod = [null], testException = [null]]], dirtiesContext [false].>有高手给我解答一下吗

解决方案 »

  1.   

    sql嵌套出错了吧??
    字段太小?
      

  2.   

    就一条查询语句 没有嵌套的,在数据库是number(19)
      

  3.   

    GroupResult 和表结构拿出来看看啊
      

  4.   

    看看你的DOMAIN类是不是属性设置,还有就是我很奇怪,你select * from CS_GROUP是返回一个List,为何变成一个GROUP对象了?这里是不是也是问题啊
      

  5.   


    把你映射的那个类的相应的该字段对应的属性的类型改成 BigDecimal再试。
      

  6.   

    private java.lang.Integer ID;
    private java.lang.String DYNAACCESSCLASS;
    private java.lang.String DYANPARAMS;
    private java.lang.Integer DYNA;
    private java.lang.Integer OPERATE_TIME;
    private java.lang.String OPERATOR;
    private java.lang.Integer REMOVED;
    private java.lang.String CODE;
    private java.lang.String NAME;
    private java.lang.String DESCRIPTION;
    意思是把java.lang.Integer  换成 BigDecimal
      

  7.   

    hibernate的数据类型小了   往大的调一哈  试试
      

  8.   

    建议:你让hibernate自动生成VO和映射文件  就没有问题了
      

  9.   

    用number不要指定长度,就ok了