basedtpropertiesid.java

来自「一个购房管理系统,JSF+Hibernate+Mssql2」· Java 代码 · 共 108 行

JAVA
108
字号
package com.housesale.hibernate.base;

import java.io.Serializable;


public abstract class BaseDtpropertiesId implements Serializable {

	protected int hashCode = Integer.MIN_VALUE;

	private java.lang.Integer id;
	private java.lang.String property;


	public BaseDtpropertiesId () {}
	
	public BaseDtpropertiesId (
		java.lang.Integer id,
		java.lang.String property) {

		this.setId(id);
		this.setProperty(property);
	}


	/**
	 * Return the value associated with the column: id
	 */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the value related to the column: id
	 * @param id the id value
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
	}



	/**
	 * Return the value associated with the column: property
	 */
	public java.lang.String getProperty () {
		return property;
	}

	/**
	 * Set the value related to the column: property
	 * @param property the property value
	 */
	public void setProperty (java.lang.String property) {
		this.property = property;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.housesale.hibernate.DtpropertiesId)) return false;
		else {
			com.housesale.hibernate.DtpropertiesId mObj = (com.housesale.hibernate.DtpropertiesId) obj;
			if (null != this.getId() && null != mObj.getId()) {
				if (!this.getId().equals(mObj.getId())) {
					return false;
				}
			}
			else {
				return false;
			}
			if (null != this.getProperty() && null != mObj.getProperty()) {
				if (!this.getProperty().equals(mObj.getProperty())) {
					return false;
				}
			}
			else {
				return false;
			}
			return true;
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			StringBuilder sb = new StringBuilder();
			if (null != this.getId()) {
				sb.append(this.getId().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			if (null != this.getProperty()) {
				sb.append(this.getProperty().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			this.hashCode = sb.toString().hashCode();
		}
		return this.hashCode;
	}


}

⌨️ 快捷键说明

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