Tag:mybatis

  • Custom modification of mybatis generator plug-in

    Time:2020-2-3

    In order for the front-end engineer to see the annotation description of each entity class attribute in the swagger API document, instead of looking at the data dictionary separately, and to solve the problem of manually adding corresponding annotation to each date format field when receiving and returning data in date format, modify the mybatis […]

  • Project details of building springboot + mybatis + FreeMarker

    Time:2020-1-30

    Now Java Web projects have been built more by using spring boot. One is that their configuration is simpler. The second is that the popular service architecture, spring cloud, is based on spring boot to implement specific technical details. Mybatis is also our commonly used semi-automatic persistence framework. Today, Xiaobian will lead you to build […]

  • Springboot integrates mybatis Reverse Engineering (detailed version)

    Time:2020-1-27

    Springboot integrates mybatis Reverse Engineering (detailed version) What reverse engineering Analyze the data table in the database, and automatically generate JavaBean (entity class corresponding to the database table), Dao interface (data access layer interface, which defines the method of accessing data), sqlmap (SQL statement mapping file, one-to-one correspondence with Dao layer interface class) Step1: write […]

  • Wrong foreach data type used by mybatis results in an error

    Time:2020-1-22

    cause The following error is reported when using mybatis dynamic SQL to traverse conditions: Caused by: java.lang.IllegalStateException: Type handler was null on parameter mapping for property ‘__frch_item_0’. It was either not specified and/or could not be found for the javaType (com.test.Report) : jdbcType (null) combination. at org.apache.ibatis.mapping.ParameterMapping$Builder.validate (ParameterMapping.java:117) at org.apache.ibatis.mapping.ParameterMapping$Builder.build (ParameterMapping.java:104) at org.apache.ibatis.builder.SqlSourceBuilder$ParameterMappingTokenHandler.buildParameterMapping (SqlSourceBuilder.java:123) at […]

  • Spring boot practice (XIII) | integration of mybatis (XML version)

    Time:2020-1-21

    WeChat public number: an excellent wasterIf you have any questions or suggestions, please leave a message in the background. I will try my best to solve your problems. 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 mybatis annotated […]

  • Log reading of mybatis source code

    Time:2020-1-19

    Log reading of mybatis source code This article introduces my understanding of the source code under the logging package. Logging configuration loading Let’s start with the configuration loading of the log. The loading process of various configurations of mybatis can be started fromXMLConfigBuilderClass. We locate the log loading method under this classloadCustomLogImpl: private void loadCustomLogImpl(Properties […]

  • Spring boot + mybatisplus + shardingjdbc sub database, sub table reading and writing separation and integration

    Time:2020-1-18

    This paper describes the integrated implementation of database splitting and read-write separation in the local database simulation. It is assumed that the member data is divided into two main databases according to the ID module. Each database is assigned a read database, with a total of 100 tables. As shown in the following table: library […]

  • Comparison of several data persistence frameworks hibernate, JPA, mybatis, jooq and JDBC template

    Time:2020-1-17

    Because the project needs to choose the data persistence framework, I took a look at several popular and unpopular frameworks. For complex business systems, the final conclusion is that jooq is the best in general, but it is not completely free. Finally, I chose JDBC template. Hibernate and mybatis are the two most commonly used […]

  • A very awkward use of mybatis plus

    Time:2020-1-16

    As anyone familiar with mybatis plus knows, mybatis plus provides two interfaces including predefined add, delete, modify and query operations: com.baomidou.mybatisplus.core.mapper.BaseMapper com.baomidou.mybatisplus.extension.service.IService Compared with these two interfaces, the operation is almost the same, and the name changes a little, such asBaseMapperIt’s called insert () in theIServiceIt’s called save (). Actually, I don’t know why I […]

  • Retrieve – mybatis – profile resolution

    Time:2020-1-15

    Preface We know it’s in useMybatisWe need to passSqlSessionFactoryBuildTo createSqlSessionFactoryExamples, such as: //Resource is the configuration file of mybatis InputStream inputStream = Resources.getResourceAsStream(resource); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); So let’s take a lookbuildSpecific implementation of the method public SqlSessionFactory build(Reader reader, String environment, Properties properties) { try { //Create an instance of xmlconfigbuilder and perform […]

  • SQL injector for source code analysis of mybatis plus

    Time:2020-1-14

    The WeChat public is “back-end”, focusing on the sharing of back-end technologies: Java, Golang, WEB framework, distributed middleware, service governance, and so on.The old driver gave you all the money and took you all the way to the top. It’s too late to explain. Get on the bus! Mybatis plus is an enhancement tool developed […]

  • The simplest springboot to integrate mybatis tutorial

    Time:2020-1-13

    In the previous two articles, I talked with the readers about the simplest data persistence scheme in spring boot. Although it’s simple, it’s not used much, because it’s not as convenient as mybatis. It’s a bit complicated to integrate mybatis in Spring + spring MVC. You need to configure multiple beans, which is further simplified […]