类 JimmerProperties
java.lang.Object
org.babyfish.jimmer.spring.cfg.JimmerProperties
-
嵌套类概要
嵌套类修饰符和类型类说明static classstatic classstatic class -
构造器概要
构造器构造器说明JimmerProperties(String language, String dialect, boolean showSql, boolean prettySql, boolean inlineSqlVariables, org.babyfish.jimmer.sql.runtime.DatabaseValidationMode databaseValidationMode, JimmerProperties.DatabaseValidation databaseValidation, org.babyfish.jimmer.sql.event.TriggerType triggerType, Boolean defaultDissociationActionCheckable, org.babyfish.jimmer.sql.runtime.IdOnlyTargetCheckingLevel idOnlyTargetCheckingLevel, Integer transactionCacheOperatorFixedDelay, org.babyfish.jimmer.sql.EnumType.Strategy defaultEnumStrategy, Integer defaultBatchSize, Integer defaultListBatchSize, Integer offsetOptimizingThreshold, Boolean isForeignKeyEnabledByDefault, boolean saveCommandPessimisticLock, Collection<String> executorContextPrefixes, String microServiceName, JimmerProperties.ErrorTranslator errorTranslator, JimmerProperties.Client client) -
方法概要
修饰符和类型方法说明intorg.babyfish.jimmer.sql.EnumType.Strategyintorg.babyfish.jimmer.sql.dialect.DialectIf this option is configured, when jimmer calls back `org.babyfish.jimmer.sql.runtime.Executor.execute` before executing SQL, it will check the stack trace information of the current thread.org.babyfish.jimmer.sql.runtime.IdOnlyTargetCheckingLevelintFor RDBMS, pagination is slow if `offset` is large, especially for MySQL.org.babyfish.jimmer.sql.event.TriggerTypebooleanbooleanThis configuration is only useful forJoinColumnof local associations (not remote associations across microservice boundaries) whose `foreignKeyType` is specified as `AUTO`.Its value indicates whether the foreign key is real, that is, whether there is a foreign key constraint in the database.booleanbooleanbooleanbooleantoString()
-
构造器详细资料
-
JimmerProperties
public JimmerProperties(@Nullable String language, @Nullable String dialect, boolean showSql, boolean prettySql, boolean inlineSqlVariables, @Deprecated @Nullable org.babyfish.jimmer.sql.runtime.DatabaseValidationMode databaseValidationMode, @Nullable JimmerProperties.DatabaseValidation databaseValidation, @Nullable org.babyfish.jimmer.sql.event.TriggerType triggerType, @Nullable Boolean defaultDissociationActionCheckable, @Nullable org.babyfish.jimmer.sql.runtime.IdOnlyTargetCheckingLevel idOnlyTargetCheckingLevel, @Nullable Integer transactionCacheOperatorFixedDelay, @Nullable org.babyfish.jimmer.sql.EnumType.Strategy defaultEnumStrategy, @Nullable Integer defaultBatchSize, @Nullable Integer defaultListBatchSize, @Nullable Integer offsetOptimizingThreshold, @Nullable Boolean isForeignKeyEnabledByDefault, boolean saveCommandPessimisticLock, @Nullable Collection<String> executorContextPrefixes, @Nullable String microServiceName, @Nullable JimmerProperties.ErrorTranslator errorTranslator, @Nullable JimmerProperties.Client client)
-
-
方法详细资料
-
getLanguage
-
getDialect
@NotNull public org.babyfish.jimmer.sql.dialect.Dialect getDialect() -
isShowSql
public boolean isShowSql() -
isPrettySql
public boolean isPrettySql() -
isInlineSqlVariables
public boolean isInlineSqlVariables() -
getDatabaseValidation
-
getTriggerType
@NotNull public org.babyfish.jimmer.sql.event.TriggerType getTriggerType() -
isDefaultDissociationActionCheckable
public boolean isDefaultDissociationActionCheckable() -
getIdOnlyTargetCheckingLevel
@NotNull public org.babyfish.jimmer.sql.runtime.IdOnlyTargetCheckingLevel getIdOnlyTargetCheckingLevel() -
getDefaultEnumStrategy
@NotNull public org.babyfish.jimmer.sql.EnumType.Strategy getDefaultEnumStrategy() -
getDefaultBatchSize
public int getDefaultBatchSize() -
getDefaultListBatchSize
public int getDefaultListBatchSize() -
getOffsetOptimizingThreshold
public int getOffsetOptimizingThreshold()For RDBMS, pagination is slow if `offset` is large, especially for MySQL. If `offset` >= $thisArgument
will be automatically changed toselect t.* from Table t ... limit ? offset ?select t.* from ( select t.id as optimized_core_id_ from Table t ... limit ? offset ? ) optimized_core_ inner join Table as optimized_ on optimized_.optimized_core_id_ = optimized_core_.optimized_core_id_- 返回:
- An integer which is greater than 0
-
isForeignKeyEnabledByDefault
public boolean isForeignKeyEnabledByDefault()This configuration is only useful forJoinColumnof local associations (not remote associations across microservice boundaries) whose `foreignKeyType` is specified as `AUTO`.Its value indicates whether the foreign key is real, that is, whether there is a foreign key constraint in the database.In general, you should ignore this configuration (defaults to true) or set it to true.
In some cases, you need to set it to false, such as- Using database/table sharding technology, such as sharding-jdbc
- Using database that does not support foreign key, such as TiDB
-
isSaveCommandPessimisticLock
public boolean isSaveCommandPessimisticLock() -
getExecutorContextPrefixes
If this option is configured, when jimmer calls back `org.babyfish.jimmer.sql.runtime.Executor.execute` before executing SQL, it will check the stack trace information of the current thread. However, these stack traces have too much information, including infrastructure call frames represented by jdk, jdbc driver, jimmer, and spring, and the business-related information you care about will be submerged in the ocean of information. Through this configuration, you can specify multiple package or class prefixes, and jimmer will judge whether there are some call frames in the stack trace whose class names start with some of these prefixes. If the judgment is true, jimmer believes that the current callback is related to your business, and the `ctx` parameter of `org.babyfish.jimmer.sql.runtime.Executor.execute` will be passed as non-null. If the SQL logging configuration is enabled at the same time, when a SQL statement is caused by the business you care about, the business call frame will be printed together with the SQL log. -
getMicroServiceName
-
getErrorTranslator
-
getClient
-
toString
-