ITeye博客

a942010的博客

a942010 · 共 2 篇文章

mybatis小练习

项目目录如上所示。 图3:这个是myBatisconfig.xml的配置,在这里定义了两个别名,Student和Teacher会在StudentMapper.xml中用到。中间是JDBC的配置,下面是mapper映射配置,StudentMapper.xml配置包含了下面两幅图的内容,只是部分的。 图1 result 里面的property属性对应的是实体类的set属性,column对应的是数据库结果集字段。这里用到了association联合查询。结果集是teacherMap,property="teacher",对应在student类中需要维护一个teacher对象,并提供get,set …

2015-01-08 10:38 · mybatis · 评论(0)

自己学的关于springMVC的简单实现(基于注解)

首先是Spring的配置 web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>…

2014-10-20 11:11 · 评论(0)