框架学习之路二

Posted xixiyunan

tags:

篇首语:本文由小常识网(cha138.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,

 















































































以上是关于框架学习之路二的主要内容,如果未能解决你的问题,请参考以下文章

HBase框架学习之路

框架学习之路一

深度学习框架PaddlePaddle的新特性与炼成之路

猿创征文|我的四个月Java学习成长之路——从基础到框架再到项目

python学习之路web框架

OSGi 学习之路 - 概述什么是OSGi框架