MyBatis-Plus简单使用——全局策略配置 (8)

时间:2025-03-20 12:15:24
<!-- 定义MybatisPlus的全局策略配置--> <bean id ="globalConfiguration" class=""> <!-- 驼峰命名的映射,在2.3版本以后,dbColumnUnderline 默认值就是true --> <property name="dbColumnUnderline" value="true"></property> <!-- Mysql 全局的主键策略(替代实体中@TableId(value = "id", type = )) AUTO(0, "数据库ID自增"), INPUT(1, "用户输入ID"), ID_WORKER(2, "全局唯一ID"), UUID(3, "全局唯一ID"), NONE(4, "该类型为未设置主键类型"), ID_WORKER_STR(5, "字符串全局唯一ID"); --> <property name="idType" value="0"></property> <!-- 全局的表前缀策略配置 --> <!--<property name="tablePrefix" value="tab_"></property>--> </bean>