java.lang.Object
org.miaixz.bus.mapper.support.keysql.KeySqlRegistry
- All Implemented Interfaces:
Registry
处理实体类上的主键策略,自动配置主键生成逻辑。
如果方法通过 MyBatis 注解(如 @Options 或 @SelectKey)配置了主键策略,将记录警告信息并跳过实体类上的主键策略配置。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
KeySqlRegistry
public KeySqlRegistry()
-
-
Method Details
-
customize
public void customize(TableMeta entity, org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.builder.annotation.ProviderContext context) 自定义主键策略,检查并应用实体类上的主键生成策略。- Specified by:
customizein interfaceRegistry- Parameters:
entity- 实体表信息ms- MappedStatement 对象context- 提供者上下文,包含方法和接口信息- Throws:
RuntimeException- 如果存在多个字段配置了主键策略
-