Category : mybatis

WeChat Public Number: An Outstanding Disabled PersonIf you have any questions or suggestions, please leave a message backstage. I will try my best to solve your problem. Preface For example, today I will introduce the integration of SpringBoot and Mybatis and the use of Mybatis. I have previously introduced the use of SpringBoot’s integrated MyBatis ..

Read more

1. Add dependencies. In addition to the packages required by SSM, the packages to be added are mybatis-ehcache.jar, ehcache-spring-annotations.jar; Maven coordinates are as follows: <!–Mybatis-ehcache–> <dependency> <groupId>org.mybatis.caches</groupId> <artifactId>mybatis-ehcache</artifactId> <version>1.0.3</version> </dependency> <!–ehcache-spring-annotations–> <dependency> <groupId>com.googlecode.ehcache-spring-annotations</groupId> <artifactId>ehcache-spring-annotations</artifactId> <version>1.2.0</version> </dependency> 2.echache profile, as follows: ehcache.xml <?xml version=”1.0″ encoding=”UTF-8″?> <ehcache xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”http://ehcache.org/ehcache.xsd”> <diskStore path=”java.io.tmpdir”/> <defaultCache maxElementsInMemory=”3000″ eternal=”false” timeToIdleSeconds=”3600″ timeToLiveSeconds=”3600″ overflowToDisk=”true” ..

Read more

Mybatis series SpringBoot integration mybatis Analysis and loading of mybatis statement How does mybatis generate its implementation class based on mapper interface Mapper of mybatis returns map result set Assembly of mybatis results I. usemybatis-spring-boot-starter 1. Add Dependencies <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.0.0</version> </dependency> 2. Import the specified sql (application.properties) spring.datasource.schema=import.sql 3. annotation form @SpringBootApplication @MapperScan(“sample.mybatis.mapper”) ..

Read more

Mybatis series SpringBoot integration mybatis Analysis and loading of mybatis statement How does mybatis generate its implementation class based on mapper interface Mapper of mybatis returns map result set Assembly of mybatis results Specify the key value of map through MapKey. @MapKey(“id”) Map<Long, UserInfo> getUserInfoMap(); @MapKey(“id”) Map<Long, Map<String,Object>> getUserValueMap(); Map’s value is a java class. ..

Read more