Giter Site home page Giter Site logo

mybatis's Introduction

mybatis 映射文件自动加载

mybatis mapper xml auto reload

###切莫用于生产环境(后果自负)!

  • mybatis映射文件热加载(发生变动后自动重新加载).

  • 方便开发时使用,不用每次修改xml文件后都要去重启应用.

  • 特性:

  • 支持不同的数据源。

  • 双线程实时监控,一个用来监控全局,一个用来实时监控热点文件。(100ms)(热点文件2分钟内没续修改自动过期)

  • 对于CPU不给力和映射文件庞大的应用,有一定程度的性能问题。

###使用方式(很简单)

  1. 复制文件到自己的工程中 MybatisXmlMapperAutoReloader.java
  2. spring添加配置 <bean class="com.thomas.mybatis.MybatisXmlMapperAutoReloader" ></bean>

###可选配置说明

	<!-- 设置是否启用: 默认启用 -->
	<property name="enableAutoReload" value="${mybatis.enableAutoReload}" />

	<!-- 设置sqlSessionFactory -->
	<property name="sqlSessionFactory" ref="sqlSessionFactory" />

	<!-- 设置映射文件地址 -->
	<property name="mapperLocations" value="classpath*:mybatis/bean/mapper/*.xml" />
</bean>

mybatis's People

Contributors

tangweixin 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.