MyBatis加解密插件的示例詳解
本篇文章介紹使用MyBatis插件來實(shí)現(xiàn)數(shù)據(jù)庫字段加解密的過程。
一、需求背景
公司出于安全合規(guī)的考慮,需要對明文存儲在數(shù)據(jù)庫中的部分字段進(jìn)行加密,防止未經(jīng)授權(quán)的訪問以及個(gè)人信息泄漏。
由于項(xiàng)目已停止迭代,改造的成本太大,因此我們選用了MyBatis插件來實(shí)現(xiàn)數(shù)據(jù)庫加解密,保證往數(shù)據(jù)庫寫入數(shù)據(jù)時(shí)能對指定字段加密,讀取數(shù)據(jù)時(shí)能對指定字段解密。
二、思路解析
2.1 系統(tǒng)架構(gòu)
對每個(gè)需要加密的字段新增密文字段(對業(yè)務(wù)有侵入),修改數(shù)據(jù)庫、mapper.xml以及DO對象,通過插件的方式把針對明文/密文字段的加解密進(jìn)行收口。
自定義Executor對SELECT/UPDATE/INSERT/DELETE等操作的明文字段進(jìn)行加密并設(shè)置到密文字段。
自定義插件ResultSetHandler負(fù)責(zé)針對查詢結(jié)果進(jìn)行解密,負(fù)責(zé)對SELECT等操作的密文字段進(jìn)行解密并設(shè)置到明文字段。
2.2 系統(tǒng)流程
新增加解密流程控制開關(guān),分別控制寫入時(shí)是只寫原字段/雙寫/只寫加密后的字段,以及讀取時(shí)是讀原字段還是加密后的字段。
新增歷史數(shù)據(jù)加密任務(wù),對歷史數(shù)據(jù)批量進(jìn)行加密,寫入到加密后字段。
出于安全上的考慮,流程里還會有一些校驗(yàn)/補(bǔ)償?shù)娜蝿?wù),這里不再贅述。
三、方案制定
3.1 MyBatis插件簡介
MyBatis 預(yù)留了 org.apache.ibatis.plugin.Interceptor 接口,通過實(shí)現(xiàn)該接口,我們能對MyBatis的執(zhí)行流程進(jìn)行攔截,接口的定義如下:
public interface Interceptor { Object intercept(Invocation invocation) throws Throwable; Object plugin(Object target); void setProperties(Properties properties); }
其中有三個(gè)方法:
- 【intercept】:插件執(zhí)行的具體流程,傳入的Invocation是MyBatis對被代理的方法的封裝。
- 【plugin】:使用當(dāng)前的Interceptor創(chuàng)建代理,通常的實(shí)現(xiàn)都是 Plugin.wrap(target, this),wrap方法內(nèi)使用 jdk 創(chuàng)建動(dòng)態(tài)代理對象。
- 【setProperties】:參考下方代碼,在MyBatis配置文件中配置插件時(shí)可以設(shè)置參數(shù),在setProperties函數(shù)中調(diào)用 Properties.getProperty("param1") 方法可以得到配置的值。
<plugins> <plugin interceptor="com.xx.xx.xxxInterceptor"> <property name="param1" value="value1"/> </plugin> </plugins>
在實(shí)現(xiàn)intercept函數(shù)對MyBatis的執(zhí)行流程進(jìn)行攔截前,我們需要使用@Intercepts注解指定攔截的方法。
@Intercepts({ @Signature(type = Executor.class, method = "update", args = { MappedStatement.class, Object.class }), @Signature(type = Executor.class, method = "query", args = { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }) })
參考上方代碼,我們可以指定需要攔截的類和方法。當(dāng)然我們不能對任意的對象做攔截,MyBatis件可攔截的類為以下四個(gè)。
Executor
StatementHandler
ParameterHandler
ResultSetHandler
回到數(shù)據(jù)庫加密的需求,我們需要從上面四個(gè)類里選擇能用來實(shí)現(xiàn)入?yún)⒓用芎统鰠⒔饷艿念?。在介紹這四個(gè)類之前,需要對MyBatis的執(zhí)行流程有一定的了解。
3.2 Spring-MyBatis執(zhí)行流程
(1)Spring通過sqlSessionFactoryBean創(chuàng)建sqlSessionFactory,在使用sqlSessionFactoryBean時(shí),我們通常會指定configLocation和mapperLocations,來告訴sqlSessionFactoryBean去哪里讀取配置文件以及去哪里讀取mapper文件。
(2)得到配置文件和mapper文件的位置后,分別調(diào)用XmlConfigBuilder.parse()和XmlMapperBuilder.parse()創(chuàng)建Configuration和MappedStatement,Configuration類顧名思義,存放的是MyBatis所有的配置,而MappedStatement類存放的是每條SQL語句的封裝,MappedStatement以map的形式存放到Configuration對象中,key為對應(yīng)方法的全路徑。
(3)Spring通過ClassPathMapperScanner掃描所有的Mapper接口,為其創(chuàng)建BeanDefinition對象,但由于他們本質(zhì)上都是沒有被實(shí)現(xiàn)的接口,所以Spring會將他們的BeanDefinition的beanClass屬性修改為MapperFactorybean。
(4)MapperFactoryBean也實(shí)現(xiàn)了FactoryBean接口,Spring在創(chuàng)建Bean時(shí)會調(diào)用FactoryBean.getObject()方法獲取Bean,最終是通過mapperProxyFactory的newInstance方法為mapper接口創(chuàng)建代理,創(chuàng)建代理的方式是JDK,最終生成的代理對象是MapperProxy。
(5)調(diào)用mapper的所有接口本質(zhì)上調(diào)用的都是MapperProxy.invoke方法,內(nèi)部調(diào)用sqlSession的insert/update/delete等各種方法。
MapperMethod.java public Object execute(SqlSession sqlSession, Object[] args) { Object result; if (SqlCommandType.INSERT == command.getType()) { Object param = method.convertArgsToSqlCommandParam(args); result = rowCountResult(sqlSession.insert(command.getName(), param)); } else if (SqlCommandType.UPDATE == command.getType()) { Object param = method.convertArgsToSqlCommandParam(args); result = rowCountResult(sqlSession.update(command.getName(), param)); } else if (SqlCommandType.DELETE == command.getType()) { Object param = method.convertArgsToSqlCommandParam(args); result = rowCountResult(sqlSession.delete(command.getName(), param)); } else if (SqlCommandType.SELECT == command.getType()) { if (method.returnsVoid() && method.hasResultHandler()) { executeWithResultHandler(sqlSession, args); result = null; } else if (method.returnsMany()) { result = executeForMany(sqlSession, args); } else if (method.returnsMap()) { result = executeForMap(sqlSession, args); } else { Object param = method.convertArgsToSqlCommandParam(args); result = sqlSession.selectOne(command.getName(), param); } } else if (SqlCommandType.FLUSH == command.getType()) { result = sqlSession.flushStatements(); } else { throw new BindingException("Unknown execution method for: " + command.getName()); } if (result == null && method.getReturnType().isPrimitive() && !method.returnsVoid()) { throw new BindingException("Mapper method '" + command.getName() + " attempted to return null from a method with a primitive return type (" + method.getReturnType() + ")."); } return result; }
(6)SqlSession可以理解為一次會話,SqlSession會從Configuration中獲取對應(yīng)MappedStatement,交給Executor執(zhí)行。
DefaultSqlSession.java @Override public <E> List<E> selectList(String statement, Object parameter, RowBounds rowBounds) { try { // 從configuration對象中使用被調(diào)用方法的全路徑,獲取對應(yīng)的MappedStatement MappedStatement ms = configuration.getMappedStatement(statement); return executor.query(ms, wrapCollection(parameter), rowBounds, Executor.NO_RESULT_HANDLER); } catch (Exception e) { throw ExceptionFactory.wrapException("Error querying database. Cause: " + e, e); } finally { ErrorContext.instance().reset(); } }
(7)Executor會先創(chuàng)建StatementHandler,StatementHandler可以理解為是一次語句的執(zhí)行。
(8)然后Executor會獲取連接,具體獲取連接的方式取決于Datasource的實(shí)現(xiàn),可以使用連接池等方式獲取連接。
(9)之后調(diào)用StatementHandler.prepare方法,對應(yīng)到JDBC執(zhí)行流程中的Connection.prepareStatement這一步。
(10)Executor再調(diào)用StatementHandler的parameterize方法,設(shè)置參數(shù),對應(yīng)到JDBC執(zhí)行流程的StatementHandler.setXXX()設(shè)置參數(shù),內(nèi)部會創(chuàng)建ParameterHandler方法。
SimpleExecutor.java @Override public <E> List<E> doQuery(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException { Statement stmt = null; try { Configuration configuration = ms.getConfiguration(); // 創(chuàng)建StatementHandler,對應(yīng)第7步 StatementHandler handler = configuration.newStatementHandler(wrapper, ms, parameter, rowBounds, resultHandler, boundSql); // 獲取連接,再調(diào)用conncetion.prepareStatement創(chuàng)建prepareStatement,設(shè)置參數(shù) stmt = prepareStatement(handler, ms.getStatementLog()); // 執(zhí)行prepareStatement return handler.<E>query(stmt, resultHandler); } finally { closeStatement(stmt); } }
(11)再由ResultSetHandler處理返回結(jié)果,處理JDBC的返回值,將其轉(zhuǎn)換為Java的對象。
3.3 MyBatis插件的創(chuàng)建時(shí)機(jī)
在Configuration類中,我們能看到newExecutor、newStatementHandler、newParameterHandler、newResultSetHandler這四個(gè)方法,插件的代理類就是在這四個(gè)方法中創(chuàng)建的,我以StatementHandeler的創(chuàng)建為例:
Configuration.java public StatementHandler newStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) { StatementHandler statementHandler = new RoutingStatementHandler(executor, mappedStatement, parameterObject, rowBounds, resultHandler, boundSql); // 使用責(zé)任鏈的形式創(chuàng)建代理 statementHandler = (StatementHandler) interceptorChain.pluginAll(statementHandler); return statementHandler; } InterceptorChain.java public Object pluginAll(Object target) { for (Interceptor interceptor : interceptors) { target = interceptor.plugin(target); } return target; }
interceptor.plugin對應(yīng)到我們自己實(shí)現(xiàn)的interceptor里的方法,通常的實(shí)現(xiàn)是 Plugin.wrap(target, this); ,該方法內(nèi)部創(chuàng)建代理的方式為JDK。
3.4 MyBatis插件可攔截類選擇
Mybatis本質(zhì)上是對JDBC執(zhí)行流程的封裝。結(jié)合上圖我們簡要概括下Mybatis這幾個(gè)可被代理類的職能。
- 【Executor】: 真正執(zhí)行SQL語句的對象,調(diào)用sqlSession的方法時(shí),本質(zhì)上都是調(diào)用executor的方法,還負(fù)責(zé)獲取connection,創(chuàng)建StatementHandler。
- 【StatementHandler】: 創(chuàng)建并持有ParameterHandler和ResultSetHandler對象,操作JDBC的statement與進(jìn)行數(shù)據(jù)庫操作。
- 【ParameterHandler】: 處理入?yún)?,將Java方法上的參數(shù)設(shè)置到被執(zhí)行語句中。
- 【ResultSetHandler】: 處理SQL語句的執(zhí)行結(jié)果,將返回值轉(zhuǎn)換為Java對象。
對于入?yún)⒌募用埽覀冃枰赑arameterHandler調(diào)用prepareStatement.setXXX()方法設(shè)置參數(shù)前,將參數(shù)值修改為加密后的參數(shù),這樣一看好像攔截Executor/StatementHandler/ParameterHandler都可以。
但實(shí)際上呢?由于我們的并不是在原始字段上做加密,而是新增了一個(gè)加密后字段,這會帶來什么問題?請看下面這條mapper.xml文件中加了加密后字段的動(dòng)態(tài)SQL:
<select id="selectUserList" resultMap="BaseResultMap" parameterType="com.xxx.internet.demo.entity.UserInfo"> SELECT * FROM `t_user_info` <where> <if test="phone != null"> `phone` = #{phone} </if> <!-- 明文字段--> <if test="secret != null"> AND `secret` = #{secret} </if> <!-- 加密后字段--> <if test="secretCiper != null"> AND `secret_ciper` = #{secretCiper} </if> <if test="name"> AND `name` = #{name} </if> </where> ORDER BY `update_time` DESC </select>
可以看到這條語句帶了動(dòng)態(tài)標(biāo)簽,那肯定不能直接交給JDBC創(chuàng)建prepareStatement,需要先將其解析成靜態(tài)SQL,而這一步是在Executor在調(diào)用StatementHandler.parameterize()前做的,由MappedStatementHandler.getBoundSql(Object parameterObject)函數(shù)解析動(dòng)態(tài)標(biāo)簽,生成靜態(tài)SQL語句,這里的parameterObject我們可以暫時(shí)先將其看成一個(gè)Map,鍵值分別為參數(shù)名和參數(shù)值。
那么我們來看下用StatementHandler和ParameterHandler做參數(shù)加密會有什么問題,在執(zhí)行MappedStatementHandler.getBoundSql時(shí),parameterObject中并沒有寫入加密后的參數(shù),在判斷標(biāo)簽時(shí)必定為否,最后生成的靜態(tài)SQL必然不包含加密后的字段,后續(xù)不管我們在StatementHandler和ParameterHandler中怎么處理parameterObject,都無法實(shí)現(xiàn)入?yún)⒌募用堋?/p>
因此,在入?yún)⒌募用苌衔覀冎荒苓x擇攔截Executor的update和query方法。
那么返回值的解密呢?參考流程圖,我們能對ResultSetHandler和Executor做攔截,事實(shí)也確實(shí)如此,在處理返回值這一點(diǎn)上,這兩者是等價(jià)的,ResultSetHandler.handleResultSet()的返回值直接透傳給Executor,再由Executor透傳給SqlSession,所以兩者任選其一就可以。
四、方案實(shí)施
在知道需要攔截的對象后,就可以開始實(shí)現(xiàn)加解密插件了。首先定義一個(gè)方法維度的注解。
/** * 通過注解來表明,我們需要對那個(gè)字段進(jìn)行加密 */ @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented public @interface TEncrypt { /** * 加密時(shí)從srcKey到destKey * @return */ String[] srcKey() default {}; /** * 解密時(shí)從destKey到srcKey * @return */ String[] destKey() default {}; }
將該注解打在需要加解密的DAO層方法上。
UserMapper.java public interface UserMapper { @TEncrypt(srcKey = {"secret"}, destKey = {"secretCiper"}) List<UserInfo> selectUserList(UserInfo userInfo); }
修改xxxMapper.xml文件
<mapper namespace="com.xxx.internet.demo.mapper.UserMapper"> <resultMap id="BaseResultMap" type="com.xxx.internet.demo.entity.UserInfo"> <id column="id" jdbcType="BIGINT" property="id" /> <id column="phone" jdbcType="VARCHAR" property="phone"/> <id column="secret" jdbcType="VARCHAR" property="secret"/> <!-- 加密后映射--> <id column="secret_ciper" jdbcType="VARCHAR" property="secretCiper"/> <id column="name" jdbcType="VARCHAR" property="name" /> </resultMap> <select id="selectUserList" resultMap="BaseResultMap" parameterType="com.xxx.internet.demo.entity.UserInfo"> SELECT * FROM `t_user_info` <where> <if test="phone != null"> `phone` = #{phone} </if> <!-- 明文字段--> <if test="secret != null"> AND `secret` = #{secret} </if> <!-- 加密后字段--> <if test="secretCiper != null"> AND `secret_ciper` = #{secretCiper} </if> <if test="name"> AND `name` = #{name} </if> </where> ORDER BY `update_time` DESCv </select> </mapper>
做完上面的修改,我們就可以編寫加密插件了
@Intercepts({ @Signature(type = Executor.class, method = "update", args = { MappedStatement.class, Object.class }), @Signature(type = Executor.class, method = "query", args = { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }) }) public class ExecutorEncryptInterceptor implements Interceptor { private static final ObjectFactory DEFAULT_OBJECT_FACTORY = new DefaultObjectFactory(); private static final ObjectWrapperFactory DEFAULT_OBJECT_WRAPPER_FACTORY = new DefaultObjectWrapperFactory(); private static final ReflectorFactory REFLECTOR_FACTORY = new DefaultReflectorFactory(); private static final List<String> COLLECTION_NAME = Arrays.asList("list"); private static final String COUNT_SUFFIX = "_COUNT"; @Override public Object intercept(Invocation invocation) throws Throwable { // 獲取攔截器攔截的設(shè)置參數(shù)對象DefaultParameterHandler final Object[] args = invocation.getArgs(); MappedStatement mappedStatement = (MappedStatement) args[0]; Object parameterObject = args[1]; // id字段對應(yīng)執(zhí)行的SQL的方法的全路徑,包含類名和方法名 String id = mappedStatement.getId(); String className = id.substring(0, id.lastIndexOf(".")); String methodName = id.substring(id.lastIndexOf(".") + 1); // 分頁插件會生成一個(gè)count語句,這個(gè)語句的參數(shù)也要做處理 if (methodName.endsWith(COUNT_SUFFIX)) { methodName = methodName.substring(0, methodName.lastIndexOf(COUNT_SUFFIX)); } // 動(dòng)態(tài)加載類并獲取類中的方法 final Method[] methods = Class.forName(className).getMethods(); // 遍歷類的所有方法并找到此次調(diào)用的方法 for (Method method : methods) { if (method.getName().equalsIgnoreCase(methodName) && method.isAnnotationPresent(TEncrypt.class)) { // 獲取方法上的注解以及注解對應(yīng)的參數(shù) TEncrypt paramAnnotation = method.getAnnotation(TEncrypt.class); // 支持加密的操作,這里只修改參數(shù) if (parameterObject instanceof Map) { List<String> paramAnnotations = findParams(method); parameterMapHandler((Map) parameterObject, paramAnnotation, mappedStatement.getSqlCommandType(), paramAnnotations); } else { encryptParam(parameterObject, paramAnnotation, mappedStatement.getSqlCommandType()); } } } return invocation.proceed(); } }
加密的主體流程如下:
- 判斷本次調(diào)用的方法上是否注解了@TEncrypt。
- 獲取注解以及在注解上配置的參數(shù)。
- 遍歷parameterObject,找到需要加密的字段。
- 調(diào)用加密方法,得到加密后的值。
- 將加密后的字段和值寫入parameterObject。
難點(diǎn)主要在parameterObject的解析,到了Executor這一層,parameterObject已經(jīng)不再是簡單的Object[],而是由MapperMethod.convertArgsToSqlCommandParam(Object[] args)方法創(chuàng)建的一個(gè)對象,既然要對這個(gè)對象做處理,我們肯定得先知道它的創(chuàng)建過程。
參考上圖parameterObject的創(chuàng)建過程,加密插件對parameterObject的處理本質(zhì)上是一個(gè)逆向的過程。如果是list,我們就遍歷list里的每一個(gè)值,如果是map,我們就遍歷map里的每一個(gè)值。
得到需要處理的Object后,再遍歷Object里的每個(gè)屬性,判斷是否在@TEncrypt注解的srcKeys參數(shù)中,如果是,則加密再設(shè)置到Object中。
解密插件的邏輯和加密插件基本一致,這里不再贅述。
五、問題挑戰(zhàn)
5.1 分頁插件自動(dòng)生成count語句
業(yè)務(wù)代碼里很多地方都用了 com.github.pagehelper 進(jìn)行物理分頁,參考下面的demo,在使用PageRowBounds時(shí),pagehelper插件會幫我們獲取符合條件的數(shù)據(jù)總數(shù)并設(shè)置到rowBounds對象的total屬性中。
PageRowBounds rowBounds = new PageRowBounds(0, 10); List<User> list = userMapper.selectIf(1, rowBounds); long total = rowBounds.getTotal();
那么問題來了,表面上看,我們只執(zhí)行了userMapper.selectIf(1, rowBounds)這一條語句,而pagehelper是通過改寫SQL增加limit、offset實(shí)現(xiàn)的物理分頁,在整個(gè)語句的執(zhí)行過程中沒有從數(shù)據(jù)庫里把所有符合條件的數(shù)據(jù)讀出來,那么pagehelper是怎么得到數(shù)據(jù)的總數(shù)的呢?
答案是pagehelper會再執(zhí)行一條count語句。先不說額外一條執(zhí)行count語句的原理,我們先看看加了一條count語句會導(dǎo)致什么問題。
參考之前的selectUserList接口,假設(shè)我們想選擇secret為某個(gè)值的數(shù)據(jù),那么經(jīng)過加密插件的處理后最終執(zhí)行的大致是這樣一條語句 "select * from t_user_info where secret_ciper = ? order by update_time limit ?, ?"。
但由于pagehelper還會再執(zhí)行一條語句,而由于該語句并沒有 @TEncrypt 注解,所以是不會被加密插件攔截的,最終執(zhí)行的count語句是類似這樣的: "select count(*) from t_user_info where secret = ? order by update_time"。
可以明顯的看到第一條語句是使用secret_ciper作為查詢條件,而count語句是使用secret作為查詢條件,會導(dǎo)致最終得到的數(shù)據(jù)總量和實(shí)際的數(shù)據(jù)總量不一致。
因此我們在加密插件的代碼里對count語句做了特殊處理,由于pagehelper新增的count語句對應(yīng)的mappedStatement的id固定以"_COUNT"結(jié)尾,而這個(gè)id就是對應(yīng)的mapper里的方法的全路徑,舉例來說原始語句的id是"com.xxx.internet.demo.entity.UserInfo.selectUserList",那么count語句的id就是"com.xxx.internet.demo.entity.UserInfo.selectUserList_COUNT",去掉"_COUNT"后我們再判斷對應(yīng)的方法上有沒有注解就可以了。
六、總結(jié)
本文介紹了使用 MyBatis 插件實(shí)現(xiàn)數(shù)據(jù)庫字段加解密的探索過程,實(shí)際開發(fā)過程中需要注意的細(xì)節(jié)比較多,整個(gè)流程下來我對 MyBatis 的理解也加深了??偟膩碚f,這個(gè)方案比較輕量,雖然對業(yè)務(wù)代碼有侵入,但能把影響面控制到最小。
到此這篇關(guān)于MyBatis加解密插件的文章就介紹到這了,更多相關(guān)MyBatis加解密內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
基于Comparator對象集合實(shí)現(xiàn)多個(gè)條件按照優(yōu)先級的比較
這篇文章主要介紹了基于Comparator對象集合實(shí)現(xiàn)多個(gè)條件按照優(yōu)先級的比較,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2021-07-07Java實(shí)現(xiàn)在線預(yù)覽的示例代碼(openOffice實(shí)現(xiàn))
本篇文章主要介紹了Java實(shí)現(xiàn)在線預(yù)覽的示例代碼(openOffice實(shí)現(xiàn)),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-11-11JAVA HTTP反向代理實(shí)現(xiàn)過程詳解
這篇文章主要介紹了JAVA HTTP反向代理實(shí)現(xiàn)過程詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-06-06Spring中@Transactional注解關(guān)鍵屬性和用法小結(jié)
在Spring框架中,@Transactional 是一個(gè)注解,用于聲明事務(wù)性的方法,它提供了一種聲明式的事務(wù)管理方式,避免了在代碼中直接編寫事務(wù)管理相關(guān)的代碼,本文給大家介紹@Transactional 注解的一些關(guān)鍵屬性和用法,感興趣的朋友一起看看吧2023-12-12詳解Java如何進(jìn)行Base64的編碼(Encode)與解碼(Decode)
這篇文章主要介紹了詳解Java如何進(jìn)行Base64的編碼(Encode)與解碼(Decode),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-03-03mybatis-plus(insertBatchSomeColumn批量添加方式)
這篇文章主要介紹了mybatis-plus(insertBatchSomeColumn批量添加方式),具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-03-03使用ScheduledThreadPoolExecutor踩過最痛的坑
這篇文章主要介紹了使用ScheduledThreadPoolExecutor踩過最痛的坑及解決方案,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-08-08