Mybatis related settings
Jun 26, 2017 am 09:18 AMMyBatis settings
Study notes:
Mybatis The setting information can be configured or not configured. After configuring the setting of Mybatis, it will affect its runtime behavior. The following are the keywords of related setting information and their meanings:
aggressiveLazyLoding: When enabled (true is also the default value), calls to any lazy attribute will be loaded with lazy loading Properties object is fully loaded.
If not enabled (false), each attribute will be loaded as needed.
autoMappingBehavior: Specify how Mybatis automatically maps to fields or attributes. It contains three values:
NONE: Cancel automatic mapping.
## PARTIAL (default value): Only result sets that do not define nested result set mappings will be mapped.
FULL: Automatically map any complex result set.
callSettersOnNulls: When the value in the specified result set is null, whether to call the mapping object color setter (not put when mapping the object) method, this is for Map.keySet() dependencies or null value initialization is useful when.
The default value is false
##Note: Basic types int and Boolean cannot be set to null.
cacheEnabled: Affects the cache global switch configured in all mappers. The default value is true.defaultExecutorType: Configure the default executor.
## SIMPLE: Simple executor
REUSE: The executor will reuse prepared statements (prepared, statements)
BATCH: The executor will reuse statements and perform batch updates.
defaultStatementTimeout: Set the supermarket time, which determines the corresponding number of seconds the driver waits for the database. When it is not set, the driver’s default waiting seconds are used.
The default value is Not Set(null)
##defaultScriptingLanguage: Specifies the default language generated by dynamic SQL. The default value is:
duct[\n] org.apche.ibatis.sc.ripting.xmltags.XMLDynamicLanguageDriver
You can customize the alias of the class or the fully qualified name of the class.
localCacheScope: Mybatis uses the local cache mechanism (Local Cache) to prevent circular references (circular references) and accelerate repeated nested queries.
The default value is SESSION Cache all queries executed in a session
STATEMENT Session is only used for statement execution, and different queries for the same SqlSession The call will not share data
jdbcTypeForNull: When no specific jdbc type is provided for the parameter, specify the JDBC type for the null value. Some drivers need to specify the JDBC type of the column. In most cases, just use the general type, such as NULL, VARCHAR, OTHER (default value)
##safeRowBoundsEnabled: Allowed to be used in nested statements Pagination (RowBounds).
The default value is false
mapUnderscoreToCamelCase: Whether to enable camel case naming rule (camel case) mapping, that is, from the classic database column name A_COLUMN to the classic Similar mapping of Java property aColumn.
The default value is false
useGeneratedKeys: Allows JDBC to automatically generate primary keys and requires driver compatibility. If set to true, it forces the use of automatically generated primary keys. Although some drivers are incompatible, they can still work normally.
The default value is false
multipleResultSetsEnabled: Whether to allow a single statement to return multiple result sets (requires compatible driver).
The default value is true.
The above is the detailed content of Mybatis related settings. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to set the scheduled time for publishing works on Douyin? How does it set the video duration?

Where is the Douyin tag set? How can it be tagged so that it can be pushed accurately?

Setting up Chinese with VSCode: The Complete Guide

Do Not Disturb Mode Not Working in iPhone: Fix

Where to set Douyin recommendations and selections

How to set the watermark in the middle on Weibo_How to set the watermark in the middle on Weibo

How to set up scheduled publishing on Weibo_Tutorial on how to set up scheduled publishing on Weibo

How to set the countdown to grab tickets in Damai
