使用JDBCTemplate实现与Spring结合,方法公用
2017-06-06 20:08
573 查看
该篇博文主要是体现了接口和类的公用性,
Emp的实体类:
package org.entity;
import java.util.Date;
/**
* Emp entity. @author MyEclipse Persistence Tools
*/
public class Emp implements java.io.Serializable {
// Fields
private Integer empno;
private String ename;
private String job;
private Short mgr;
private Date hiredate;
private Double sal;
private Double comm;
/** default constructor */
public Emp() {
}
/** minimal constructor */
public Emp(Integer empno) {
this.empno = empno;
}
// Property accessors
public Integer getEmpno() {
return this.empno;
}
public void setEmpno(Integer empno) {
this.empno = empno;
}
public String getEname() {
return this.ename;
}
public void setEname(String ename) {
this.ename = ename;
}
public String getJob() {
return this.job;
}
public void setJob(String job) {
this.job = job;
}
public Short getMgr() {
return this.mgr;
}
public void setMgr(Short mgr) {
this.mgr = mgr;
}
public Date getHiredate() {
return this.hiredate;
}
public void setHiredate(Date hiredate) {
this.hiredate = hiredate;
}
public Double getSal() {
return this.sal;
}
public void setSal(Double sal) {
this.sal = sal;
}
public Double getComm() {
return this.comm;
}
public void setComm(Double comm) {
this.comm = comm;
}
}
Emp的实体类:
package org.entity;
import java.util.Date;
/**
* Emp entity. @author MyEclipse Persistence Tools
*/
public class Emp implements java.io.Serializable {
// Fields
private Integer empno;
private String ename;
private String job;
private Short mgr;
private Date hiredate;
private Double sal;
private Double comm;
/** default constructor */
public Emp() {
}
/** minimal constructor */
public Emp(Integer empno) {
this.empno = empno;
}
// Property accessors
public Integer getEmpno() {
return this.empno;
}
public void setEmpno(Integer empno) {
this.empno = empno;
}
public String getEname() {
return this.ename;
}
public void setEname(String ename) {
this.ename = ename;
}
public String getJob() {
return this.job;
}
public void setJob(String job) {
this.job = job;
}
public Short getMgr() {
return this.mgr;
}
public void setMgr(Short mgr) {
this.mgr = mgr;
}
public Date getHiredate() {
return this.hiredate;
}
public void setHiredate(Date hiredate) {
this.hiredate = hiredate;
}
public Double getSal() {
return this.sal;
}
public void setSal(Double sal) {
this.sal = sal;
}
public Double getComm() {
return this.comm;
}
public void setComm(Double comm) {
this.comm = comm;
}
}
相关文章推荐
- 使用JDBCTemplate实现与Spring结合,方法公用 ——共用实现类(BaseImpl)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——测试(EmpDaoImplTest)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——Emp实现类(EmpDaoImpl)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——Spring配置(applicationContext.xml)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——接口(BaseDao)
- 使用Spring3.0的AOP结合log4j实现接口方法执行时间记录
- Spring、Ibatis结合MySQL数据库的使用方法
- Spring使用JdbcTemplate实现对数据库操作 (内部类定义RowMapper)
- 使用Spring中的aspect或advisor实现方法拦截,模拟缓存实现
- spring注入的方式实现静态方法中使用非静态变量
- java使用spring实现发送mail的方法
- 关于在Spring下 使用HQL 语句模糊查询的实现方法
- js队列方法使用push(xx)结合shift()实现或者使用pop()结合unshift()实现
- Spring中JDBCTemplate使用queryForObject方法时 ”Incorrect column count: expected 1, actual 5“错误
- Python使用logging结合decorator模式实现优化日志输出的方法
- Block方法与Block属性结合使用的小实现
- Spring使用JdbcTemplate插入和修改数据的三种方法
- spring jdbcTemplate 使用占位符(?)的query方法进行多表查询
- Spring JdbcTemplate 查询方法中的RowMapper实现汇总
- 关于mysql 数据库使用spring 2.0低版本 JdbcTemplate.queryForList 查询结果别名不起作用的解决方法