Hibernate中使用Criteria查询及注解——(Dept.java)
2017-03-08 23:27
489 查看
Dept.java:
部门表的实体类:
package cn.bdqn.hibernate_Criteria.entity;
import java.util.HashSet;
import java.util.Set;
/**
* 部门表的实体类
* @author 1111
*
*/
public class Dept implements java.io.Serializable {
// Fields
private Integer deptno;
private String dname;
private String loc;
private Set emps = new HashSet(0);
// Constructors
/** default constructor */
public Dept() {
}
/** minimal constructor */
public Dept(Integer deptno) {
this.deptno = deptno;
}
/** full constructor */
public Dept(Integer deptno, String dname, String loc, Set emps) {
this.deptno = deptno;
this.dname = dname;
this.loc = loc;
this.emps = emps;
}
// Property accessors
public Integer getDeptno() {
return this.deptno;
}
public void setDeptno(Integer deptno) {
this.deptno = deptno;
}
public String getDname() {
return this.dname;
}
public void setDname(String dname) {
this.dname = dname;
}
public String getLoc() {
return this.loc;
}
public void setLoc(String loc) {
this.loc = loc;
}
public Set getEmps() {
return this.emps;
}
public void setEmps(Set emps) {
this.emps = emps;
}
}
部门表的实体类:
package cn.bdqn.hibernate_Criteria.entity;
import java.util.HashSet;
import java.util.Set;
/**
* 部门表的实体类
* @author 1111
*
*/
public class Dept implements java.io.Serializable {
// Fields
private Integer deptno;
private String dname;
private String loc;
private Set emps = new HashSet(0);
// Constructors
/** default constructor */
public Dept() {
}
/** minimal constructor */
public Dept(Integer deptno) {
this.deptno = deptno;
}
/** full constructor */
public Dept(Integer deptno, String dname, String loc, Set emps) {
this.deptno = deptno;
this.dname = dname;
this.loc = loc;
this.emps = emps;
}
// Property accessors
public Integer getDeptno() {
return this.deptno;
}
public void setDeptno(Integer deptno) {
this.deptno = deptno;
}
public String getDname() {
return this.dname;
}
public void setDname(String dname) {
this.dname = dname;
}
public String getLoc() {
return this.loc;
}
public void setLoc(String loc) {
this.loc = loc;
}
public Set getEmps() {
return this.emps;
}
public void setEmps(Set emps) {
this.emps = emps;
}
}
相关文章推荐
- Hibernate中使用Criteria查询及注解——(DeptTest.java)
- Hibernate中使用Criteria查询及注解——(Emp.java)
- Hibernate中使用Criteria查询及注解——(Dept.hbm.xml)
- Hibernate中使用Criteria查询及注解——(hibernate.cfg.xml)
- Hibernate中使用Criteria查询及注解——( EmpCondition)
- Java的Hibernate框架中Criteria查询使用的实例讲解
- Hibernate中使用Criteria查询及注解——(Emp.hbm.xml)
- Hibernate中使用Criteria查询及注解——(HibernateUtil)
- 关于Hibernate中fatch=eager的bag集合(一个java List)使用Criteria查询出现重复记录的问题
- Java Hibernate注解使用
- java开源框架集成常见错误之使用Criteria添加查询条件出现java.lang.ClassCastException异常
- Hibernate-Criteria查询(3)DetachedCriteria构造查询条件、命名查询、原生SQL、调用存储过程(使用JDBC)
- JavaEE Tutorials (12) - 创建和使用基于字符串的Criteria查询
- Atitit.Hibernate于Criteria 使用汇总and 关系查询 and 按照子对象查询 o9o
- (hibernate查询)DetachedCriteria对象创建可以不需要使用session去创建
- 【java】itoo项目实战之大数据查询之使用 new map 优化hibernate之级联查询
- 灵活使用Hibernate的查询对象DetachedCriteria
- Java Hibernate中使用HQL语句进行数据库查询的要点解析
- Hibernate使用DetachedCriteria和Criteria查询
- Hibernate里面如何使用DetachedCriteriaCriteria 实现多条件分页查询