MySQL數(shù)據(jù)庫更換成Oracle
敬愛的Allen老師? 很幸運 能看到您的講解,恰好 公司需要用到guns,不過公司需要把這個MySQL數(shù)據(jù)庫更換成Oracle,換完之后 錯誤重重!首先是日志不能創(chuàng)建,并且所有的顯示 增刪改功能都不好用,調(diào)了好幾天了表示沒脾氣呀? 問下您 更換數(shù)據(jù)庫后 需要修改什么地方才能正常使用呢
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?
2018-01-26
之前我也修改過這一部分,主要有幾個問題:
1、原生的Guns里是沒有考慮Oracle的,所以引用了很多不通用的函數(shù),比如const,這一部分需要更換
2、Guns基礎(chǔ)框架中,基礎(chǔ)功能的sql返回都是map,不是對象。 但是由于Oracle返回的字段全是大寫,但是Mysql是區(qū)分大小寫,所以這一部分要統(tǒng)一把返回的map 的key全部替換為大寫字母
3、Guns里大量的應(yīng)用了自增主鍵,這一部分在Oracle里需要更換主鍵生成方式【參加Mybatis-plus的修改方式】
主要是以上幾個部分,其他的都是細枝末節(jié)了,祝好運
2018-07-25
老師你好~~能發(fā)份適用Oracle的工程嗎 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?