<?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 配置文件 配置别名的更多相关文章

  1. MyBatis学习总结(三)——MyBatis配置文件配置的优化

    一.连接数据库的配置单独放在一个properties文件中 上文 连接数据库的配置写在 mybatisConf.xml中,本文直接放在 db.properties 中, 在mybatisConf.xm ...

  2. MyBatis学习总结(三)——优化MyBatis配置文件中的配置(转载)

    本文转载自:http://www.cnblogs.com/jpf-java/p/6013548.html 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置 ...

  3. MyBatis入门学习教程-优化MyBatis配置文件中的配置

    一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...

  4. MyBatis学习总结(三)——优化MyBatis配置文件中的配置

    一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...

  5. MyBatis学习总结(三)——优化MyBatis配置文件中的配置

    一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: <?xml version="1 ...

  6. MyBatis——优化MyBatis配置文件中的配置

    原文:http://www.cnblogs.com/xdp-gacl/p/4264301.html 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写 ...

  7. MyBatis学习总结_03_优化MyBatis配置文件中的配置

    一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...

  8. 【转】MyBatis学习总结(三)——优化MyBatis配置文件中的配置

    [转]MyBatis学习总结(三)——优化MyBatis配置文件中的配置 一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的con ...

  9. MyBatis的学习总结三:优化MyBatis配置文件中的配置

    一.优化Mybatis配置文件conf.xml中数据库的信息 1.添加properties的配置文件,存放数据库的信息:mysql.properties具体代码: driver=com.mysql.j ...

随机推荐

  1. English trip V1 - 24. Accommodations Teacher:Maple Key: make suggestions 提出建议

    In this lesson you will learn to make suggestions. 在本课程中,您将学习如何提出建议. 课上内容(Lesson) Which place  would ...

  2. ASP.Net MVC多语言

    .NET MVC 多语言网站 通过浏览器语言首选项改变MVC的语言,通过浏览器语言选项,修改脚本语言. 一.添加资源文件 1.添加App_GlobalResources文件夹. 2.添加默认的资源文件 ...

  3. 小程序for循环嵌套

    <view class='nocontnt' wx:if="{{listLength == 0 }}"> 暂无相关评论 </view> <view c ...

  4. PTA L2-002 链表去重

    题目链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805072641245184 第一次做链表题,有时间多看看 解释 ...

  5. Oracle11g温习-第十二章:tables

    2013年4月27日 星期六 10:44 1.表的功能 存储.管理数据的基本单元(二维表:由行和列组成) 2.表的类型  1)普通表:[heap table(堆表) :数据存储时,无序的,对它的访问采 ...

  6. Json:前台对象数组传到后台解析

    本文转自:http://blog.csdn.net/kymegg/article/details/50964581 方法:使用JsonArray进行解析 步骤: 一.引入一系列JAR包 要使程序便于解 ...

  7. (Nginx反向代理+NFS共享网页根目录)自动部署及可用性检测

    1.nginx反向代理安装配置 #!/usr/bin/bash if [ -e /etc/nginx/nginx.conf ] then echo 'Already installed' exit e ...

  8. from…import 语句

  9. S3cmd命令行管理对象存储

    我的使用步骤 cd /usr/    目录 git clone https://github.com/jdcloud-cmw/s3cmd.git   下载文件 ln -s /usr/s3cmd/s3c ...

  10. python 豆瓣验证码识别总结

    总结:  pytesseract 识别比较标准的图片  识别成功率   还是不错的. 验证码的图片识别 需要先处理好   再用pytesseract 识别 from PIL import Image  ...