人员的实体对象
/*
* To change this template choose Tools | Templates
* and open the template in the editor
*/
package comhadesleejpaentity;
import javaioSerializable;
import javaxpersistenceEntity;
import javaxpersistenceGeneratedValue;
import javaxpersistenceGenerationType;
import javaxpersistenceId;
import javaxpersistenceManyToOne;
import javaxpersistenceTable;
/**
*
* @author hadeslee
*/
@Entity
@Table(name = JPAPerson)
public class Person implements Serializable {
private static final long serialVersionUID = L;
@Id
@GeneratedValue(strategy = GenerationTypeAUTO)
private Integer id;
private String name;
private int age;
@ManyToOne
private Department department;
public int getAge() {
return age;
}
public void setAge(int age) {
thisage = age;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
thisdepartment = department;
}
public String getName() {
return name;
}
public void setName(String name) {
thisname = name;
}
[] [] [] [] []