⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scorepk.java

📁 Hibernate的精典实例
💻 JAVA
字号:
package hibernate.demo.compositeKey;

import java.io.Serializable;

/**
 * 复合主键类
 * 
 * @author Administrator
 * 
 */
public class ScorePK implements Serializable {
	private Integer stu_id;

	private Integer sc_id;

	public ScorePK() {

	}

	public ScorePK(Integer stu_id, Integer sc_id) {
		super();
		this.stu_id = stu_id;
		this.sc_id = sc_id;
	}

	public Integer getSc_id() {
		return sc_id;
	}

	public void setSc_id(Integer sc_id) {
		this.sc_id = sc_id;
	}

	public Integer getStu_id() {
		return stu_id;
	}

	public void setStu_id(Integer stu_id) {
		this.stu_id = stu_id;
	}

	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((sc_id == null) ? 0 : sc_id.hashCode());
		result = PRIME * result + ((stu_id == null) ? 0 : stu_id.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final ScorePK other = (ScorePK) obj;
		if (sc_id == null) {
			if (other.sc_id != null)
				return false;
		} else if (!sc_id.equals(other.sc_id))
			return false;
		if (stu_id == null) {
			if (other.stu_id != null)
				return false;
		} else if (!stu_id.equals(other.stu_id))
			return false;
		return true;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -