Module bus.mapper

Class PrimaryKeyEnhancer

java.lang.Object
org.miaixz.bus.mapper.support.keysql.PrimaryKeyEnhancer
All Implemented Interfaces:
SqlSourceEnhancer

public class PrimaryKeyEnhancer extends Object implements SqlSourceEnhancer
默认的主键生成器,处理插入前的主键生成逻辑。
Since:
Java 17+
Author:
Kimi Liu
  • Field Summary

    Fields inherited from interface org.miaixz.bus.mapper.parsing.SqlSourceEnhancer

    SPI
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.ibatis.mapping.SqlSource
    customize(org.apache.ibatis.mapping.SqlSource sqlSource, TableMeta entity, org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.builder.annotation.ProviderContext context)
    自定义 SQL 源,根据主键生成器类型进行处理。

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrimaryKeyEnhancer

      public PrimaryKeyEnhancer()
  • Method Details

    • customize

      public org.apache.ibatis.mapping.SqlSource customize(org.apache.ibatis.mapping.SqlSource sqlSource, TableMeta entity, org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.builder.annotation.ProviderContext context)
      自定义 SQL 源,根据主键生成器类型进行处理。
      Specified by:
      customize in interface SqlSourceEnhancer
      Parameters:
      sqlSource - 原始 SQL 源
      entity - 实体表信息
      ms - MappedStatement 对象
      context - 提供者上下文,包含方法和接口信息
      Returns:
      自定义后的 SQL 源