方便更快捷的说明问题,可以按需填写(可删除)
使用环境:
5.1.0最新版本,做加解密功能,没有使用其他的任何功能(分片,分表,分库)。
使用自己创建ShardingDataSource的方式实现。
对于复杂SQL,发现报错,看来是SQL不支持:
Caused by: org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: java.lang.NullPointerException
The error may exist in file [E:\CoderWork\Dolphins\oa_service\dolphins-core\target\classes\mappers\FieldMapper.xml]
The error may involve defaultParameterMap
The error occurred while setting parameters
SQL: SELECT old.id AS id, old.name, new.id AS quoteId, new.name FROM s_field old INNER JOIN (SELECT id, relate_field, name FROM s_field WHERE show_type = ‘quote’ AND verify_type = ‘customer_addr’ AND function_id = ? AND tenant_id = 1 AND tenant_id = 1) new ON new.relate_field = old.copy_field_id WHERE old.tenant_id = 1 UNION SELECT old.id AS id, old.name, new.id AS quoteId, new.name FROM s_field old INNER JOIN (SELECT id, relate_field, name FROM s_field WHERE show_type = ‘quote’ AND verify_type != ‘customer_addr’ AND function_id = ? AND tenant_id = 1 AND tenant_id = 1) new ON new.relate_field = old.id WHERE old.tenant_id = 1
Cause: java.lang.NullPointerException
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
... 171 more
Caused by: java.lang.NullPointerException
at org.apache.shardingsphere.infra.binder.segment.select.subquery.engine.SubqueryTableContextEngine.createSubqueryTableContexts(SubqueryTableContextEngine.java:43)
at org.apache.shardingsphere.infra.binder.segment.table.TablesContext.createSubqueryTables(TablesContext.java:85)
at org.apache.shard