当配置mybatis返回int类型时 select id="getUserIdByName" parameterType="string" resultType="int"> SELECT id FROM user WHERE userName = #{userName} </select> 会报错如下: org.springframework.web.util.NestedServletException: Request p
mybatis更新sql语句: <update id="publishT00_notice" parameterType="Map"> update test set createdate = #{createdate}, creator = #{creator} where id in <foreach collection="ids" item="ids" separator=","
一.BLOB字段 BLOB是指二进制大对象也就是英文Binary Large Object的所写,而CLOB是指大字符对象也就是英文Character Large Object的所写.其中BLOB是用来存储大量二进制数据的:CLOB用来存储大量文本数据.BLOB通常用来保存图片.文件等二进制类型的数据. 二.使用mybatis操作blob 1.表结构如下: create table BLOB_FIELD ( ID BYTE) not null, TAB_NAME BYTE) not null,
mybatis 比 ibatis 改进了很多,特别是支持了注解,支持了plugin inteceptor,也给开发者带来了更多的灵活性,相比其他ORM,我还是挺喜欢mybatis的. 闲言碎语不要讲,今天研究了下mybatis的typeHandler: 先看这样一张表(postgresql) create table user ( id serial not null name ), age integer, emails character varchar[], -- varchar 数组 表
零:sql动态语句中经常会有根据数据库某个字段状态进行判断的 如:status=0为未激活,status=1为激活的,那搜索未激活时: <if test="model.activeStatus != null and model.activeStatus !='' or model.activeStatus==0"> and status=#{model.activeStatus} </if> 但由于java的int类型默认值为0,导致0与null的判定无法识别