1112

<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

	<!-- 加载配置文件 -->
	<properties resource="db.properties">
		<property name="jdbc.driver" value="oracle.jdbc.driver.OracleDriver" />
		<!-- 定义缺省值,加载配置文件遇到同名时,会被重新赋值 -->
	</properties>

	<!-- 定义别名 -->
	<typeAliases>
		<!-- 单个定义 -->
		<typeAlias type="org.mybatis.model.Customer" alias="Customer" />
		<!-- 批量定义,别名默认为类名首字母小写或大写 -->
		<package name="org.mybatis.model" />
	</typeAliases>

	<!-- 定义环境 -->
	<environments default="development">
		<environment id="development">
			<transactionManager type="JDBC" /><!-- 使用jdbc事务管理 -->
			<dataSource type="POOLED">
				<property name="driver" value="${jdbc.driver}" />
				<property name="url" value="${jdbc.url}" />
				<property name="username" value="${jdbc.username}" />
				<property name="password" value="${jdbc.password}" />
			</dataSource>
		</environment>
	</environments>

	<!-- 加载mapper.xml -->
	<mappers>
		<mapper resource="org/mybatis/model/sqlmap/customer.xml" />
	</mappers>
	
</configuration>
package org.mybatis.model;

import java.util.Date;

public class Customer {
	private int id;//ID
	private String name;// 姓名
	private String sex;// 性别
	private Date birthday;// 生日
	private String address;// 地址

	public Customer() {
		super();
	}

	public Customer(String name, String sex, Date birthday, String address) {
		super();
		this.name = name;
		this.sex = sex;
		this.birthday = birthday;
		this.address = address;
	}

	public Customer(int id, String name, String sex, Date birthday, String address) {
		super();
		this.id = id;
		this.name = name;
		this.sex = sex;
		this.birthday = birthday;
		this.address = address;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

}


你可能感兴趣的:(1112)