码迷,mamicode.com
首页 > 其他好文 > 详细

框架学习之路二

时间:2018-11-15 23:39:57      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:port   mis   解析   alt   学习   pac   安装   etl   .com   

上一章我们使用了xml解析技术和java反射技术实现了一个简单的功能,这一章我们更进一步,模仿mybatis,实现一个sql映射功能

 

1,安装mysql

2,新建数据库myemployees,并建下表employees

技术分享图片

3,创建对应的实体类

package com.epro.domin;

import java.util.Date;

public class Employee {
private int employee_id;
private String first_name;
private String last_name;
private String email;
private String phone_number;
private String job_id;
private double salary;
private float commision_pct;
private int manager_id;
private Date hiredate;
public int getEmployee_id() {
return employee_id;
}
public void setEmployee_id(int employee_id) {
this.employee_id = employee_id;
}
public String getFirst_name() {
return first_name;
}
public void setFirst_name(String first_name) {
this.first_name = first_name;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String last_name) {
this.last_name = last_name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public String getJob_id() {
return job_id;
}
public void setJob_id(String job_id) {
this.job_id = job_id;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
public float getCommision_pct() {
return commision_pct;
}
public void setCommision_pct(float commision_pct) {
this.commision_pct = commision_pct;
}
public int getManager_id() {
return manager_id;
}
public void setManager_id(int manager_id) {
this.manager_id = manager_id;
}
public Date getHiredate() {
return hiredate;
}
public void setHiredate(Date hiredate) {
this.hiredate = hiredate;
}
@Override
public String toString() {
return "Employee [employee_id=" + employee_id + ", first_name=" + first_name + ", last_name=" + last_name
+ ", email=" + email + ", phone_number=" + phone_number + ", job_id=" + job_id + ", salary=" + salary
+ ", commision_pct=" + commision_pct + ", manager_id=" + manager_id + ", hiredate=" + hiredate + "]";
}

}

4,

 

框架学习之路二

标签:port   mis   解析   alt   学习   pac   安装   etl   .com   

原文地址:https://www.cnblogs.com/xixiyunan/p/9966816.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!