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

📄 parent.java

📁 是关于struts+hibernate+spring开发宝典的源代码,希望对大家有帮助,
💻 JAVA
字号:
package cn.hxex.hibernate.mapping.model;

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

public class Parent {

	private String id;
	private Set children = new HashSet();
	
	public Set getChildren() {
		return children;
	}
	public void setChildren(Set children) {
		this.children = children;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	public boolean equals( Object obj ) {
		if( obj==null ) return false;
		
		if( obj instanceof Parent ) {
			Parent p = (Parent)obj;
			if( this.id==null ) {
				return p.getId()==null;
			} else {
				return this.id.equals( p.getId() );
			}
		}
		return false;
	}
	
	public int hashCode() {
		if( id!=null ) return id.hashCode();
		return 0;
	}
}

⌨️ 快捷键说明

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