MyBatis通用Mapper3,极其方便的使用MyBatis单表的增删改查 最新版本3.3.0增加对动态表名的支持,需要实体类继承IDynamicTableName接口,用法见详细说明 Example增加自定义查询条件,提供了4个方法,具体方法和用法见详细说明 新增@ColumnType注解,可以单独设置列的jdbcType和typeHandler Example的in和not in中的List<Object>参数改为List<?>,允许任意类型 select查询方法返回类型不在使用resultType,改为resultMap,因此可以支持typeHandler的读取 Style自动转方式新增camelhumpAndUppercase驼峰转下划线大写形式,camelhumpAndLowercase驼峰转下划线小写形式 MapperTemplate中的getSelectReturnType方法改为getEntityClass,getBEFORE改为isBEFORE 文档中增加@GeneratedValue(strategy = GenerationType.IDENTITY)的一种重要用法说明 修复selectAll不支持@OrderBy注解的bug 解决一个驼峰转换bug,例如helloWorld会转换为hello_world(原先是hello_World)
使用Maven1 2 3 4 5 | < dependency >
< groupId >tk.mybatis</ groupId >
< artifactId >mapper</ artifactId >
< version >3.3.0</ version >
</ dependency >
|
引入Jar包,下载地址:https://oss.sonatype.org/content/repositories/releases/tk/mybatis/mapper http://repo1.maven.org/maven2/tk/mybatis/mapper 由于通用Mapper依赖JPA,所以还需要下载persistence-api-1.0.jar: http://repo1.maven.org/maven2/javax/persistence/persistence-api/1.0/ 更多MyBatis相关内容可以访问: www.mybatis.tk |