hibernate注解实体类(Dept.java)
2023-09-14 08:57:40 时间
Dept.java
部门信息表的实体类详情
package cn.bdqn.hibernate_Criteria.entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
* Dept entity. @author MyEclipse Persistence Tools
*/
@Entity
@Table(name="dept")
public class Dept implements java.io.Serializable {
@Id
private Integer deptno;
@Column(name="dname")
private String dname;
@Transient
private String loc;
/*级联操作*/
@OneToMany(mappedBy="dept",cascade={CascadeType.ALL})
private Set emps = new HashSet(0);
public Dept1() {
}
public Dept1(Integer deptno) {
this.deptno = deptno;
}
public Dept1(Integer deptno, String dname, String loc, Set emps) {
this.deptno = deptno;
this.dname = dname;
this.loc = loc;
this.emps = emps;
}
public Dept1(Integer deptno, String dname) {
this.deptno = deptno;
this.dname = dname;
}
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;
}
}
相关文章
- Java 开发环境配置--eclipse工具进行java开发
- ssh(Spring+Spring mvc+hibernate)——DeptDaoImpl.java
- hibernate注解实体类(Emp.java)
- Hibernate中使用Criteria查询及注解——(Emp.java)
- JAVA学习(五):Java面向对象编程基础
- Java实现第八届蓝桥杯取数位
- Java实现 蓝桥杯 基础练习 查找整数
- Hibernate学习--hibernate延迟加载原理-动态代理(阿里电面)
- Atitit 搜索蓝牙设备 powershell的实现 java noede.js python 先用脚本语言python nodejs,不好实现。。Java 也不好实现。。 Netcore可以,
- Atitit.跨语言反射api 兼容性提升与增强 java c#。Net php js
- Interview:Java岗位面试—面试求职攻略之一个JAVA程序员面试心得(非常值得收藏)
- java计算代码执行时间
- java - 集合List remove 报错 ConcurrentModificationException
- Java学习路线-48:Servlet学习
- 解决idea出现的java.lang.OutOfMemoryError: Java heap space的问题
- Java Instrumentation 内存马——主要是利用Instrumentation Java API来做内存注入,会用到反射机制,文中提到检测思路:注入jar包-> dump已加载class字节码->反编译成java代码-> 源码webshell检测
- 【java】Java并发编程系列-基础知识(非常详细哦)
- JAVA开发讲义(二)-Java程序设计之数据之谜二