![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Ibatis/MyBatis
文章平均质量分 60
qq123zhz
这个作者很懒,什么都没留下…
展开
-
ibatis3 一个小bug
Ibatis 3 mapper映射文件名称大小写问题: 居然名字CPManagerSqlMapper.xml有个字母应该小写的(CpManagerSqlMapper.xml),结果大写了,在配置文件: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//ibati...原创 2010-08-04 18:18:06 · 512 阅读 · 0 评论 -
mybatis OGNL应用扩展
mybatis中使用ognl的扩展,实现判断传入的字段: Mapper文件中: <select id="getRecentQuestionTitle" parameterType="java.lang.String" resultType="java.lang.String"> select title from song_question where questio...2012-03-22 15:54:40 · 90 阅读 · 0 评论 -
mybatis 应该注意的地方
1) 在parameterMap和resultMap中,字段数据类型是java.sql.Types类定义的常量名称。常用的数据类型包括BLOB,CHAR,CLOB,DATE,LONGVARBINARY, INTEGER,NULL,NUMERIC,TIME,TIMESTAMP和VARCHAR等。 2) 对于数据表中NULLBALE的字段,必须在parameterMap和resultMap中...原创 2012-03-17 11:59:43 · 116 阅读 · 0 评论 -
mybatis like查询
<if test="useroperator != null" > and t.useroperator like CONCAT(CONCAT('%', #{useroperator}),'%') </if>原创 2011-08-12 10:02:33 · 69 阅读 · 0 评论 -
mybatis 后台分页实现
package page; public interface Dialect { public boolean supportsLimit(); public String getLimitString(String sql, boolean hasOffset); public String getLimitString(String sq...2011-07-14 15:16:17 · 182 阅读 · 0 评论 -
mybatis 使用ognl
@Ognl@isNotEmpty() for String,Array,Collection,Map Test now, test empty string test. must use:<if test="userId != null && ''.equals(userId)"> and user_id = #{userId}</if>but, OGN...原创 2011-08-22 15:12:05 · 669 阅读 · 1 评论 -
mybatis mysql 时间段
unix_timestamp(questiontime) between unix_timestamp(#{questiontime[0]}) and unix_timestamp( #{questiontime[1]}) 代表: #{questiontime[0]})<questiontime<#{questiontime[1]},意思你懂得。。。...原创 2011-08-16 08:20:33 · 133 阅读 · 0 评论 -
ibatis3 一对一搞定
配置文件:<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd"> <mapp2010-08-10 14:31:03 · 111 阅读 · 0 评论 -
ibatis3 一对一关联
ibatis2 里面result标签可以设置select查询 一对一 <result property="info" column="userid" select="getUserInfoByUserId" /> 为什么ibatis3 没有了呢? 那ibatis3 用什么来设置一对一关联呢,难道是 <association property=...2010-08-10 11:41:26 · 79 阅读 · 0 评论 -
ibatis3 一个小疑惑
<select id="selectAllPicType" resultType="java.util.hashMap" resultType="com.contentlib.beans.SysDicBean"> select t1.item_id as data,t1.item_name as label from CTT_DICTYPE T,CTT_SYS_DIC T1 WH...2010-08-04 18:24:28 · 84 阅读 · 0 评论 -
mybatis 拦截器,改变默认行为
页面输入:男,数据库保存male,女,数据库保存为female。 使用interceptor,typeHandler package cn.dcr.mybatis.util; import java.util.Properties; import org.apache.ibatis.executor.Executor; import org.apache.ibatis.mapp...原创 2012-03-29 16:00:48 · 378 阅读 · 0 评论