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

package cn.bdqn.studentInfo.entity;

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

/**
 * 学生表的实体类
 * @author Administrator
 *
 */
public class Student {
	private Integer id;
	private String name;
	private Set<Teacher>teachers=new HashSet<Teacher>();
	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<Teacher> getTeachers() {
		return teachers;
	}
	public void setTeachers(Set<Teacher> teachers) {
		this.teachers = teachers;
	}
	public Student(Integer id, String name, Set<Teacher> teachers) {
		super();
		this.id = id;
		this.name = name;
		this.teachers = teachers;
	}
	public Student() {
		super();
	}

	
}

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