情景:

mybatis连接oracle

报错:

测试增的时候,报错 Java.lang.Long cannot be cast to  java.lang.Integer;删改没有报错。

排查过程:

1.先针对映射的sql进行排查,打印sql,直接在oracle上执行,没有问题。

2.观察接口的返回结果,发现返回值定义为int,找到问题所在。

问题虽小,但发现问题的时间稍长。从另一个方面说明,代码生成很有必要。

java.lang.Long cannot be cast to java.lang.Integer解决办法的更多相关文章

  1. [记录]java.math.biginteger cannot be cast to java.lang.long

    可以直接使用BigInteger类型进行接收, BigInteger id = (BigInteger)QueryRunner(conn,"SELECT LAST_INSERT_ID&quo ...

  2. 利用泛型抽取Dao层,加事务注解问题(java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType)

    想利用泛型抽取BaseDao层,简化操作时出现故障: @Transactional这个注解是能够继承的.于是就想写在抽取的BaseDao层上,让实现的类能够不用写@Transactional,就可开启 ...

  3. 数据转换失败 java.math.BigDecimal cannot be cast to java.lang.String

    从接口获取到数据,在转换的时候出现错误:java.math.BigDecimal cannot be cast to java.lang.String 因为一开始用的是使用关键字进行强制转换,后来发现 ...

  4. mysql连接报java.math.BigInteger cannot be cast to java.lang.Long异常

    使用hibernate出现以下错误 java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot b ...

  5. 【问题解决:连接异常】 java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

    问题描述: MySQL更新到8.0.11之后连接数据库时会报出错误 Your login attempt was not successful, try again.Reason: Could not ...

  6. java.lang.ClassCastException: java.lang.Short cannot be cast to java.lang.String(Short类型无法强转成String类型)

    有一行Java代码如下: String code1 = (String)qTable1.getValueAt(i, 0); 这是一个Java的图形界面获取表格中值的代码,其中qTable1.getVa ...

  7. 数据转换bug花了半天时间 Java.math.BigDecimal cannot be cast to java.lang.String

    从数据库取出一个 Count函数 统计的值 在代码中要转成Integer类型的时候 Integer.parseInt((String)map.get("ID_")) 报了一下错误: ...

  8. java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer

    hibernate查询结果条数集 原写法: Integer count = (Integer )session.createQuery(hql).uniqueResult(); 报错:java.lan ...

  9. MySQL分段统计SQL写法 与 Mybatis 异常 java.math.BigDecimal cannot be cast to java.lang.Integer

    mysql> select end) as '<60', end) as '60~69', end) as '70~79', end) as '80~89', end) as '>= ...

随机推荐

  1. Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds问题

    错误:Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requi ...

  2. d3 API axis

    场景 1.画网格线 使用方法.innerTickSize(): 指定内刻度大小 或者 .tickSize(inner, outer): 2.内外刻度线 innerTickSize outerTickS ...

  3. runtime记录

    前言: 最初对于runtime的了解其实只停留在,知道这是一组C的方法,知道消息机制中会把方法调用转成objc_msgSend(theObject,@selector(objectMethod)).随 ...

  4. Database Schemas Found in Oracle E-Business Suite

    https://docs.oracle.com/cd/E26401_01/doc.122/e22952/T156458T659606.htm Table of Database Schemas in ...

  5. On One Side Kolmogorov Type Inequalities

    Let \(X_1,X_2,\ldots,X_n\) be independent random variables. Denote \[S_n=\sum_{i=1}^n X_i.\] The  we ...

  6. 开源库Magicodes.ECharts使用教程

    目录 1    概要    2 2    Magicodes.ECharts工作原理    3 2.1    架构说明    3 2.1.1    Axis    4 2.1.2    CommonD ...

  7. 创建widget

    1. 定义方法 def predictAll(tickers, startdt='36', enddt = 'today', predictdays = 1): if enddt == 'today' ...

  8. CentOS7(mini) 急速部署ASP.NET应用

    从mono 2.8+的时候就开始关注linux运行.NET的一些消息 最近闲来无事,发现mono官方已经提供有编译好的源,极大便利了部署过程,不需要自己去编译mono了 用Nancy.Owin写了一个 ...

  9. Backbone源码解析(一):Event模块

    Backbone是一个当下比较流行的MVC框架.它主要分为以下几个模块: Events, View, Model, Collection, History, Router等几大模块.它强制依赖unde ...

  10. 里氏替换原则(Liskov Substitution Principle)

    开放封闭原则(Open Closed Principle)是构建可维护性和可重用性代码的基础.它强调设计良好的代码可以不通过修改而扩展,新的功能通过添加新的代码来实现,而不需要更改已有的可工作的代码. ...