mybatis
枫叶的记忆
勤奋 欣赏 包容 感恩
展开
-
SpringMVC+MyBatis,连接池采用druid,启动报错Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
spring的数据库配置文件如下:xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:ao原创 2014-12-02 15:56:27 · 1414 阅读 · 0 评论 -
Mybatis like查询的写法
Mybatis like查询官方文档没有明确的例子可循,网上搜索了很多,都不正确。Mybatis 3.2.6经过尝试,给出三种可靠可用的写法:select * from person where name like "%"#{name}"%"select * from person where name like '%'||#转载 2014-12-28 20:38:16 · 367 阅读 · 0 评论 -
mybatis 中#与$的区别
MyBatis/Ibatis中#和$的区别1. #将传入的数据都当成一个字符串,会对自动传入的数据加一个双引号。如:order by #user_id#,如果传入的值是111,那么解析成sql时的值为order by "111", 如果传入的值是id,则解析成的sql为order by "id". 2. $将传入的数据直接显示生成在sql中。如:order by $us转载 2014-12-30 13:39:39 · 356 阅读 · 0 评论