Class BaseMapper.InsertWithoutPrimaryKeySqlProvider

java.lang.Object
cn.yusiwen.commons.mapper.BaseMapper.BaseSqlProviderSupport
cn.yusiwen.commons.mapper.BaseMapper.InsertWithoutPrimaryKeySqlProvider
Enclosing interface:
BaseMapper<S extends BaseEntity>

public static class BaseMapper.InsertWithoutPrimaryKeySqlProvider extends BaseMapper.BaseSqlProviderSupport
不包含主键的插入SQL提供者类

此类用于生成不包含主键字段的INSERT SQL语句。主要用于那些主键由数据库自动生成的表 (例如使用自增主键的表)。它会排除实体类中标记为主键的字段,只插入其他字段的值。

  • Constructor Details

    • InsertWithoutPrimaryKeySqlProvider

      public InsertWithoutPrimaryKeySqlProvider()
      创建一个新的InsertWithoutPrimaryKeySqlProvider实例。

      此构造函数用于初始化一个不包含主键的SQL插入语句提供者。 主要用于处理那些使用数据库自动生成主键的表的插入操作。

  • Method Details

    • sql

      public String sql(org.apache.ibatis.builder.annotation.ProviderContext context)
      生成不包含主键的INSERT SQL语句
      Parameters:
      context - MyBatis提供的上下文对象,包含了Mapper接口的相关信息
      Returns:
      生成的INSERT SQL语句