mybatis 配置文件 配置别名
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<typeAliases>
<typeAlias type="com.exayong.architecture1.customermgr.vo.CustomerModel" alias="CM"/>
<typeAlias type="com.exayong.architecture1.customermgr.vo.CustomerQueryModel" alias="CQM"/>
</typeAliases>
</configuration>
测试
@Service
public class Client {
@Autowired
private CustomerDAO dao = null;
public static void main(String[] args){
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
Client t = (Client) ctx.getBean("client");
CustomerModel cm = new CustomerModel();
cm.setCustomerId("c1");
cm.setPwd("c1");
cm.setRegisterTime("haha");
cm.setShowName("c1");
cm.setTrueName("李四");
t.dao.create(cm);
List<CustomerModel> list = t.dao.getByCondition(new CustomerQueryModel());
System.out.println("list=="+list);
}
}
mybatis 配置文件 配置别名的更多相关文章
- MyBatis学习总结(三)——MyBatis配置文件配置的优化
一.连接数据库的配置单独放在一个properties文件中 上文 连接数据库的配置写在 mybatisConf.xml中,本文直接放在 db.properties 中, 在mybatisConf.xm ...
- MyBatis学习总结(三)——优化MyBatis配置文件中的配置(转载)
本文转载自:http://www.cnblogs.com/jpf-java/p/6013548.html 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置 ...
- MyBatis入门学习教程-优化MyBatis配置文件中的配置
一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...
- MyBatis学习总结(三)——优化MyBatis配置文件中的配置
一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...
- MyBatis学习总结(三)——优化MyBatis配置文件中的配置
一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: <?xml version="1 ...
- MyBatis——优化MyBatis配置文件中的配置
原文:http://www.cnblogs.com/xdp-gacl/p/4264301.html 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写 ...
- MyBatis学习总结_03_优化MyBatis配置文件中的配置
一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...
- 【转】MyBatis学习总结(三)——优化MyBatis配置文件中的配置
[转]MyBatis学习总结(三)——优化MyBatis配置文件中的配置 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的con ...
- MyBatis的学习总结三:优化MyBatis配置文件中的配置
一.优化Mybatis配置文件conf.xml中数据库的信息 1.添加properties的配置文件,存放数据库的信息:mysql.properties具体代码: driver=com.mysql.j ...
随机推荐
- 20165327《Java程序设计》实验一 Java开发环境的熟悉 实验报告
20165327<Java程序设计>实验二 <Java面向对象程序设计>实验报告 实验二 <Java面向对象程序设计> 一.实验报告封面 课程:Java程序设计 班 ...
- English trip M1 - PC7 Can I Borrow Your Ping-Pong? Teacher:Patrick
In this lesson you will learn to desribe abilities. 这节课你将学习到描述你的能力 课上内容(Lesson) 三种常见情态动词 can aux. 能 ...
- java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
一.NoClassDefFoundError与ClassNotFoundException NoClassDefFoundError错误的发生,是因为Java虚拟机在编译时能找到合适的类,而在运行时不 ...
- hdu-3366 Passage 概率DP 读懂就能AC hhh
http://acm.split.hdu.edu.cn/showproblem.php?pid=3366 读题的时候没发现这个P Q 1-P-Q是全集的划分,以为是独立事件,写错了转移方程233 先贪 ...
- salt相关
salt安装 https://docs.saltstack.com/en/latest/topics/installation/index.html#quick-install salt远程 ...
- Vue音乐项目笔记(二)
1. Vuex https://blog.csdn.net/weixin_40814356/article/details/80347366 编写: 然后,在main.js中引入 在组件中改变stat ...
- P3489 付公主的背包
题意:n<=1e5,m<=1e5,跑n个物品1到m容量的完全背包. 考虑暴力的做法就是把一些1/(1+x^a)的多项式乘起来即可. 考虑优化,取一下ln,转化为加法,然后exp回去就好了.
- Linux中磁盘mbr分区——实践篇
Linux中磁盘mbr分区——实践篇 fdisk命令 语法 fdisk(选项)(参数) 选项 -b <分区大小> 指定每个分区的大小 -l 列出分区表信息 -v 显示版本信息 参数 设备文 ...
- 141. Linked List Cycle&142. Linked List Cycle II(剑指Offer-链表中环的入口节点)
题目: 141.Given a linked list, determine if it has a cycle in it. 142.Given a linked list, return the ...
- js事件流 事件捕获 及时间冒泡详解
Javascript与HTML之间的交互是通过事件实现. 一.事件流 事件,是文档或浏览器窗口中发生的一些特定的交互瞬间.事件流,描述的是页面中接受事件的顺序.IE9,chrome,Firefox,O ...