Hibernate中使用Criteria查询及注解——( EmpCondition)
EmpCondition:
动态查询的条件类:
package cn.bdqn.hibernate_Criteria.entity; import java.util.Date; /** * Criteria动态查询的条件类 * @author Administrator * */ public class EmpCondition { private String job;//职位 private Double sal;//工资 private Date hiredateStart; //入职日期的开始 private Date hiredateEnd; //入职日期的结束 public String getJob() { return job; } public void setJob(String job) { this.job = job; } public Double getSal() { return sal; } public void setSal(Double sal) { this.sal = sal; } public Date getHiredateStart() { return hiredateStart; } public void setHiredateStart(Date hiredateStart) { this.hiredateStart = hiredateStart; } public Date getHiredateEnd() { return hiredateEnd; } public void setHiredateEnd(Date hiredateEnd) { this.hiredateEnd = hiredateEnd; } public EmpCondition(String job, Double sal, Date hiredateStart, Date hiredateEnd) { super(); this.job = job; this.sal = sal; this.hiredateStart = hiredateStart; this.hiredateEnd = hiredateEnd; } public EmpCondition() { super(); } }