MySQL数据库更换成Oracle

来源:-

炑森

2018-01-25 17:05

敬爱的Allen老师  很幸运 能看到您的讲解,恰好 公司需要用到guns,不过公司需要把这个MySQL数据库更换成Oracle,换完之后 错误重重!首先是日志不能创建,并且所有的显示 增删改功能都不好用,调了好几天了表示没脾气呀  问下您 更换数据库后 需要修改什么地方才能正常使用呢




2018-01-25 16:43:35.173 DEBUG 49548 --- [nio-8080-exec-4] c.a.m.system.dao.UserMgrDao.selectUsers  : ==>  Preparing: select id, account, name, birthday, sex, email, avatar, phone, roleid, deptid, status, createtime, version from sys_user where status != 3 

2018-01-25 16:43:35.175 DEBUG 49548 --- [nio-8080-exec-4] c.a.m.system.dao.UserMgrDao.selectUsers  : ==> Parameters: 

2018-01-25 16:43:35.182 DEBUG 49548 --- [nio-8080-exec-4] c.a.m.system.dao.UserMgrDao.selectUsers  : <==      Total: 3

2018-01-25 16:43:35.185 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DictMapper.selectOne         : ==>  Preparing: SELECT id AS id,num,pid,name,tips FROM sys_dict WHERE name=? 

2018-01-25 16:43:35.186 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DictMapper.selectOne         : ==> Parameters: 性别(String)

2018-01-25 16:43:35.187 DEBUG 49548 --- [nio-8080-exec-2] c.aero.modular.system.dao.DeptDao.tree   : ==>  Preparing: select id,pid as pId,simplename as name, ( CASE WHEN (pId = 0 OR pId IS NULL) THEN '1' ELSE '0' END ) as isOpen from sys_dept 

2018-01-25 16:43:35.188 DEBUG 49548 --- [nio-8080-exec-2] c.aero.modular.system.dao.DeptDao.tree   : ==> Parameters: 

2018-01-25 16:43:35.199 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DictMapper.selectOne         : <==      Total: 1

2018-01-25 16:43:35.202 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DictMapper.selectList        : ==>  Preparing: SELECT id AS id,num,pid,name,tips FROM sys_dict WHERE (pid = ?) 

2018-01-25 16:43:35.203 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DictMapper.selectList        : ==> Parameters: 29(Integer)

2018-01-25 16:43:35.205 DEBUG 49548 --- [nio-8080-exec-2] c.aero.modular.system.dao.DeptDao.tree   : <==      Total: 4

2018-01-25 16:43:35.208 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DictMapper.selectList        : <==      Total: 2

2018-01-25 16:43:35.211 DEBUG 49548 --- [nio-8080-exec-4] c.a.c.p.dao.DeptMapper.selectById        : ==>  Preparing: SELECT id AS id,num,pid,pids,simplename,fullname,tips,version FROM sys_dept WHERE id=? 

2018-01-25 16:43:35.215 ERROR 49548 --- [nio-8080-exec-4] c.aero.core.aop.GlobalExceptionHandler   : 运行时异常:


org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='id', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)

at com.sun.proxy.$Proxy95.selectOne(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166)

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)

at com.sun.proxy.$Proxy100.selectById(Unknown Source)

at com.aero.common.constant.factory.ConstantFactory.getDeptName(ConstantFactory.java:132)

at com.aero.common.constant.factory.ConstantFactory$$FastClassBySpringCGLIB$$fe0206db.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52)

at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:344)

at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:407)

at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:326)

at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)

at 



写回答 关注

2回答

  • Allen
    2018-01-26 12:12:02
    已采纳

    之前我也修改过这一部分,主要有几个问题:

    1、原生的Guns里是没有考虑Oracle的,所以引用了很多不通用的函数,比如const,这一部分需要更换

    2、Guns基础框架中,基础功能的sql返回都是map,不是对象。 但是由于Oracle返回的字段全是大写,但是Mysql是区分大小写,所以这一部分要统一把返回的map 的key全部替换为大写字母

    3、Guns里大量的应用了自增主键,这一部分在Oracle里需要更换主键生成方式【参加Mybatis-plus的修改方式】

    主要是以上几个部分,其他的都是细枝末节了,祝好运

    Allen 回复慕粉1826...

    手里没有原始的修改以后的工程了, 改了很多业务上的东西,不过按照上面说的内容,花点时间是能改出来的

    2018-03-10 00:12:38

    共 5 条回复 >

  • qq_卢晓健WSRS_0
    2018-07-25 10:46:09

    老师你好~~能发份适用Oracle的工程吗                                

基于SpringBoot 十分钟搞定后台管理平台

大道至简之Guns框架介绍,带你领略代码自动生成

42428 学习 · 201 问题

查看课程

相似问题