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

📄 person.java

📁 一个自娱自乐的demo 开发环境 apache-tomcat-6.0.16 Mysql 5.1.11 Jdk 1.6 文件结构如下 --MyGame -----MyGam
💻 JAVA
字号:
package com.hb.base.domain.common;// Generated 2007/12/03 18:44:52 by Hibernate Tools 3.2.0.b11import java.util.ArrayList;import java.util.List;import com.hb.core.bean.BaseHibernateDomainBean;import org.apache.commons.lang.builder.EqualsBuilder;import org.apache.commons.lang.builder.HashCodeBuilder;/** * @author 何 貝 *  * 个人信息 */public class Person extends BaseHibernateDomainBean {	/***/	private static final long serialVersionUID = 787726617629401500L;	/** 男[数据库数值] */	public static final Integer MALE = 1;	/** 女[数据库数值] */	public static final Integer FEMALE = 2;	/** 男[汉字] */	public static final String MALE_STR = "男";	/** 女[汉字] */	public static final String FEMALE_STR = "女";	/** 个人ID */	private String personID;	/** 名字 */	private String name;	/** 名字拼写方法 */	private String nameSpell;	/** 年龄 */	private Integer age;	/** 性别 */	private Integer sex;	/** 从属国家 */	private Country country = new Country();	/** 从属国家ID */	private String countryID;	/** 住址信息 */	private List<Address> addressList = new ArrayList<Address>();	public Person() {	}	public Person(String personID, Country country, Integer sex) {		this.personID = personID;		this.country = country;		if (country != null) {			this.countryID = country.getCountryID();		}		this.sex = sex;	}	public Person(String personID, String name, String nameSpell, Integer age, Integer sex, Country country,			List<Address> addressList) {		this.personID = personID;		this.name = name;		this.nameSpell = nameSpell;		this.age = age;		this.country = country;		if (country != null) {			this.countryID = country.getCountryID();		}		this.addressList = addressList;		this.sex = sex;	}	public String getPersonID() {		return this.personID;	}	public void setPersonID(String personID) {		this.personID = personID;	}	public String getName() {		return this.name;	}	public void setName(String name) {		this.name = name;	}	public String getNameSpell() {		return this.nameSpell;	}	public void setNameSpell(String nameSpell) {		this.nameSpell = nameSpell;	}	public Country getCountry() {		return this.country;	}	public void setCountry(Country country) {		if (country != null) {			this.countryID = country.getCountryID();		}		this.country = country;	}	protected String getCountryID() {		return this.countryID;	}	protected void setCountryID(String countryID) {		this.countryID = countryID;	}	public void addAddresses(Address address) {		int index = 1;		for (Address _address : addressList) {			if (_address.getNo() != null) {				_address.setNo(index);				index++;			}		}		address.setNo(index);		addressList.add(address);	}	public List<Address> getAddressList() {		return this.addressList;	}	public void setAddressList(List<Address> addressList) {		this.addressList = addressList;	}	public Integer getAge() {		return age;	}	public void setAge(Integer age) {		this.age = age;	}	public String getSexStr() {		if (sex == MALE) {			return MALE_STR;		} else {			return FEMALE_STR;		}	}	public void setSexStr(String sexStr) {		if (sexStr == MALE_STR) {			sex = MALE;		} else {			sex = FEMALE;		}	}	public Integer getSex() {		return sex;	}	public void setSex(Integer sex) {		this.sex = sex;	}	/**	 * @see java.lang.Object#equals(Object)	 */	public boolean equals(Object object) {		if (!(object instanceof Person)) {			return false;		}		Person rhs = (Person) object;		return new EqualsBuilder().append(this.personID, rhs.personID).isEquals();	}	/**	 * @see java.lang.Object#hashCode()	 */	public int hashCode() {		return new HashCodeBuilder(-1935634179, -1528097211).append(this.personID).toHashCode();	}}

⌨️ 快捷键说明

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