类 GlobalConfig.DbConfig

java.lang.Object
com.baomidou.mybatisplus.core.config.GlobalConfig.DbConfig
封闭类:
GlobalConfig

public static class GlobalConfig.DbConfig extends Object
  • 构造器详细资料

    • DbConfig

      public DbConfig()
  • 方法详细资料

    • getIdType

      public com.baomidou.mybatisplus.annotation.IdType getIdType()
      主键类型
    • getTablePrefix

      public String getTablePrefix()
      表名前缀
    • getSchema

      public String getSchema()
      schema
      从以下版本开始:
      3.1.1
    • getColumnFormat

      public String getColumnFormat()
      db字段 format

      例: `%s`

      对主键无效

      从以下版本开始:
      3.1.1
    • getTableFormat

      public String getTableFormat()
      db 表 format

      例: `%s`

      从以下版本开始:
      3.5.3.2
    • getPropertyFormat

      public String getPropertyFormat()
      entity 的字段(property)的 format,只有在 column as property 这种情况下生效

      例: `%s`

      对主键无效

      从以下版本开始:
      3.3.0
    • isReplacePlaceholder

      public boolean isReplacePlaceholder()
      实验性功能,占位符替换,等同于
      引用无效
      com.baomidou.mybatisplus.extension.plugins.inner.ReplacePlaceholderInnerInterceptor
      , 只是这个属于启动时替换,用得地方多会启动慢一点点,不适用于其他的 LanguageDriver
      从以下版本开始:
      3.4.2
    • getEscapeSymbol

      public String getEscapeSymbol()
      转义符

      配合 replacePlaceholder 使用时有效

      例: " 或 ' 或 `

      从以下版本开始:
      3.4.2
    • isTableUnderline

      public boolean isTableUnderline()
      表名是否使用驼峰转下划线命名,只对表名生效
    • isCapitalMode

      public boolean isCapitalMode()
      大写命名,对表名和字段名均生效
    • getKeyGenerators

      public List<IKeyGenerator> getKeyGenerators()
      表主键生成器
    • getLogicDeleteField

      public String getLogicDeleteField()
      逻辑删除全局属性名
    • getLogicDeleteValue

      public String getLogicDeleteValue()
      逻辑删除全局值(默认 1、表示已删除)
    • getLogicNotDeleteValue

      public String getLogicNotDeleteValue()
      逻辑未删除全局值(默认 0、表示未删除)
    • getInsertStrategy

      public com.baomidou.mybatisplus.annotation.FieldStrategy getInsertStrategy()
      字段验证策略之 insert
      从以下版本开始:
      3.1.2
    • getUpdateStrategy

      public com.baomidou.mybatisplus.annotation.FieldStrategy getUpdateStrategy()
      字段验证策略之 update
      从以下版本开始:
      3.1.2
    • getWhereStrategy

      public com.baomidou.mybatisplus.annotation.FieldStrategy getWhereStrategy()
      字段验证策略之 where
      从以下版本开始:
      3.4.4
    • isInsertIgnoreAutoIncrementColumn

      public boolean isInsertIgnoreAutoIncrementColumn()
      生成INSERT语句时忽略自增主键字段(默认不忽略,主键有值时写入主键值,无值自增).

      当设置为true时,执行生成SQL语句无论ID是否有值都会忽视 (此为3.4.3.1版本下策略,如果升级遇到问题可以考虑开启此配置来兼容升级)

      从以下版本开始:
      3.5.6
    • setIdType

      public GlobalConfig.DbConfig setIdType(com.baomidou.mybatisplus.annotation.IdType idType)
      主键类型
      返回:
      this.
    • setTablePrefix

      public GlobalConfig.DbConfig setTablePrefix(String tablePrefix)
      表名前缀
      返回:
      this.
    • setSchema

      public GlobalConfig.DbConfig setSchema(String schema)
      schema
      返回:
      this.
      从以下版本开始:
      3.1.1
    • setColumnFormat

      public GlobalConfig.DbConfig setColumnFormat(String columnFormat)
      db字段 format

      例: `%s`

      对主键无效

      返回:
      this.
      从以下版本开始:
      3.1.1
    • setTableFormat

      public GlobalConfig.DbConfig setTableFormat(String tableFormat)
      db 表 format

      例: `%s`

      返回:
      this.
      从以下版本开始:
      3.5.3.2
    • setPropertyFormat

      public GlobalConfig.DbConfig setPropertyFormat(String propertyFormat)
      entity 的字段(property)的 format,只有在 column as property 这种情况下生效

      例: `%s`

      对主键无效

      返回:
      this.
      从以下版本开始:
      3.3.0
    • setReplacePlaceholder

      public GlobalConfig.DbConfig setReplacePlaceholder(boolean replacePlaceholder)
      实验性功能,占位符替换,等同于
      引用无效
      com.baomidou.mybatisplus.extension.plugins.inner.ReplacePlaceholderInnerInterceptor
      , 只是这个属于启动时替换,用得地方多会启动慢一点点,不适用于其他的 LanguageDriver
      返回:
      this.
      从以下版本开始:
      3.4.2
    • setEscapeSymbol

      public GlobalConfig.DbConfig setEscapeSymbol(String escapeSymbol)
      转义符

      配合 replacePlaceholder 使用时有效

      例: " 或 ' 或 `

      返回:
      this.
      从以下版本开始:
      3.4.2
    • setTableUnderline

      public GlobalConfig.DbConfig setTableUnderline(boolean tableUnderline)
      表名是否使用驼峰转下划线命名,只对表名生效
      返回:
      this.
    • setCapitalMode

      public GlobalConfig.DbConfig setCapitalMode(boolean capitalMode)
      大写命名,对表名和字段名均生效
      返回:
      this.
    • setKeyGenerators

      public GlobalConfig.DbConfig setKeyGenerators(List<IKeyGenerator> keyGenerators)
      表主键生成器
      返回:
      this.
    • setLogicDeleteField

      public GlobalConfig.DbConfig setLogicDeleteField(String logicDeleteField)
      逻辑删除全局属性名
      返回:
      this.
    • setLogicDeleteValue

      public GlobalConfig.DbConfig setLogicDeleteValue(String logicDeleteValue)
      逻辑删除全局值(默认 1、表示已删除)
      返回:
      this.
    • setLogicNotDeleteValue

      public GlobalConfig.DbConfig setLogicNotDeleteValue(String logicNotDeleteValue)
      逻辑未删除全局值(默认 0、表示未删除)
      返回:
      this.
    • setInsertStrategy

      public GlobalConfig.DbConfig setInsertStrategy(com.baomidou.mybatisplus.annotation.FieldStrategy insertStrategy)
      字段验证策略之 insert
      返回:
      this.
      从以下版本开始:
      3.1.2
    • setUpdateStrategy

      public GlobalConfig.DbConfig setUpdateStrategy(com.baomidou.mybatisplus.annotation.FieldStrategy updateStrategy)
      字段验证策略之 update
      返回:
      this.
      从以下版本开始:
      3.1.2
    • setWhereStrategy

      public GlobalConfig.DbConfig setWhereStrategy(com.baomidou.mybatisplus.annotation.FieldStrategy whereStrategy)
      字段验证策略之 where
      返回:
      this.
      从以下版本开始:
      3.4.4
    • setInsertIgnoreAutoIncrementColumn

      public GlobalConfig.DbConfig setInsertIgnoreAutoIncrementColumn(boolean insertIgnoreAutoIncrementColumn)
      生成INSERT语句时忽略自增主键字段(默认不忽略,主键有值时写入主键值,无值自增).

      当设置为true时,执行生成SQL语句无论ID是否有值都会忽视 (此为3.4.3.1版本下策略,如果升级遇到问题可以考虑开启此配置来兼容升级)

      返回:
      this.
      从以下版本开始:
      3.5.6
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object