¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.mybatis.handler; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.baomidou.mybatisplus.core.handlers.PostInitTableInfoHandler; |
| | | import com.baomidou.mybatisplus.core.metadata.TableInfo; |
| | | import org.apache.ibatis.session.Configuration; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.reflect.ReflectUtils; |
| | | |
| | | /** |
| | | * ä¿®æ¹è¡¨ä¿¡æ¯åå§åæ¹å¼ |
| | | * ç®åç¨äºå
¨å±ä¿®æ¹æ¯å¦ä½¿ç¨é»è¾å é¤ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public class PlusPostInitTableInfoHandler implements PostInitTableInfoHandler { |
| | | |
| | | @Override |
| | | public void postTableInfo(TableInfo tableInfo, Configuration configuration) { |
| | | String flag = SpringUtils.getProperty("mybatis-plus.enableLogicDelete", "true"); |
| | | // åªæå
³éæ¶ ç»ä¸è®¾ç½®false 为trueæ¶mpèªå¨å¤æä¸å¤ç |
| | | if (!Convert.toBool(flag)) { |
| | | ReflectUtils.setFieldValue(tableInfo, "withLogicDelete", false); |
| | | } |
| | | } |
| | | |
| | | } |