Mybatis – learning notes
configuration file
1. Properties introduces the contents of the external properties configuration file
Resource: introduce resources under the classpath
URL: introduce network path or disk path
2. Settings contains many important settings
Setting: used to set each item
Name: set item name
Value: set item value
Typealias aliases a Java type type: Specifies the class to be aliased - the default alias is the class name, and the small employeealias specifies a new name
Package aliases all classes under a package
Name: specify the package name (give a default alias (class name in lowercase) to all classes of the current package and descendant packages)
The @ alias annotation assigns a new alias to a class
3. The typealiases alias handler can alias our Java classes
(aliases are not case sensitive)
4. Environments: mybatis can configure multiple environments. Default specifies a certain environment. You can quickly switch the environment and configure a specific environment information,
There must be two labels. The ID represents the unique of the current environment, indicating the transactionmanager transaction manager type transaction manager type datasource data source
5. Databaseidprovider supports multi database vendors
Type = "db_vendor" mybatis will execute SQL according to the database vendor ID