人員的實體對象
/*
* To change this template
* and open the template in the editor
*/
package com
import java
import javax
import javax
import javax
import javax
import javax
import javax
/**
*
* @author hadeslee
*/
@Entity
@Table(name =
public class Person implements Serializable {
private static final long serialVersionUID =
@Id
@GeneratedValue(strategy = GenerationType
private Integer id;
private String name;
private int age;
@ManyToOne
private Department department;
public int getAge() {
return age;
}
public void setAge(int age) {
this
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this
}
public String getName() {
return name;
}
public void setName(String name) {
this
}
[
From:http://tw.wingwit.com/Article/program/Java/ky/201311/29046.html