GithubHelp home page GithubHelp logo

beyondchx / mybatis-spring Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abel533/mybatis-spring

0.0 1.0 0.0 1.86 MB

这是一个集成了Mybatis分页插件和通用Mapper的示例项目

Java 97.33% CSS 2.67%

mybatis-spring's Introduction

SSM集成的基础项目,项目使用Maven管理

MyBatis3.3.0

Spring[MVC]4.1.2.RELEASE

项目使用Spring4.1.2.RELEASE + SpringMVC4.1.2.RELEASE + Mybatis3.3.0

项目集成了Mybatis分页插件和通用Mapper插件

项目使用的mysql数据库,根据需要可以切换为其他数据库

集成分页插件 5.0.0 版本,注意配置变化:

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="mapperLocations">
        <array>
            <value>classpath:mapper/*.xml</value>
        </array>
    </property>
    <property name="typeAliasesPackage" value="com.isea533.mybatis.model"/>
    <property name="plugins">
        <array>
            <bean class="com.github.pagehelper.PageInterceptor">
                <!-- 这里的几个配置主要演示如何使用,如果不理解,一定要去掉下面的配置 -->
                <property name="properties">
                    <value>
                        helperDialect=mysql
                        reasonable=true
                        supportMethodsArguments=true
                        params=count=countSql
                        autoRuntimeDialect=true
                    </value>
                </property>
            </bean>
        </array>
    </property>
</bean>
  • 拦截器 com.github.pagehelper.PageInterceptor
  • 原来的 dialect 变成了 helperDialect,这是基于 PageHelper 方式的分页
  • 具体变化看文档

新书《MyBatis 从入门到精通》

MyBatis 从入门到精通

预售地址:京东当当亚马逊

CSDN博客:http://blog.csdn.net/isea533/article/details/73555400

GitHub项目:https://github.com/mybatis-book/book

Spring Boot集成MyBatis的基础项目

MyBatis工具

推荐使用Mybatis通用Mapper3

推荐使用Mybatis分页插件PageHelper

作者信息

mybatis-spring's People

Contributors

abel533 avatar bryant1410 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.