您的位置:首页 > 移动开发

mybatis 通用mapper

2017-06-06 19:07 239 查看
可用的jar 版本

mapper-3.3.9.jar

mybatis-3.4.1.jar

mybatis-spring-1.3.0.jar

pagehelper-4.1.1.jar

jsqlparser-0.9.4.jar

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">

        <property name="dataSource" ref="dataSource" />

        <property name="mapperLocations" value="classpath:mapper/*.xml"></property>

        <property name="configLocation" value="classpath:mybatis-config.xml"></property>  

    </bean>

mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE configuration

        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"

        "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
<plugins>

        <plugin interceptor="com.github.pagehelper.PageHelper">

            <property name="dialect" value="mysql"/>

            <property name="offsetAsPageNum" value="false"/>

            <property name="rowBoundsWithCount" value="false"/>

            <property name="pageSizeZero" value="true"/>

            <property name="reasonable" value="false"/>

            <property name="supportMethodsArguments" value="false"/>

            <property name="returnPageInfo" value="none"/>

        </plugin>

    </plugins>

</configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: