hibernate正向生成数据库表以及配置——Teacher.java

package cn.bdqn.studentInfo.entity;

import java.util.HashSet;
import java.util.Set;

/**
 * 老师的实体类
 * @author Administrator
 *
 */
public class Teacher {
	private Integer id;
	private String name;
	private Set<Student> students =new HashSet<Student>();
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Set<Student> getStudents() {
		return students;
	}
	public void setStudents(Set<Student> students) {
		this.students = students;
	}
	public Teacher(Integer id, String name, Set<Student> students) {
		super();
		this.id = id;
		this.name = name;
		this.students = students;
	}
	public Teacher() {
		super();
	}
	
	

}

posted @ 2017-02-27 22:38  穆雄雄  阅读(72)  评论(0编辑  收藏  举报