All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.sylinx.hbatis.ext.model.GenericModel Maven / Gradle / Ivy

There is a newer version: 2.0.0.RELEASE
Show newest version
package cn.sylinx.hbatis.ext.model;

import java.io.Serializable;

public class GenericModel extends Model {

	/**
	 * 主键
	 */
	private Serializable id;

	public Serializable getId() {
		return id;
	}

	public void setId(Serializable id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		if (getId() == null)
			return 0;
		return getId().hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		if (this.getClass() != obj.getClass()) {
			return false;
		}

		return this.hashCode() == obj.hashCode();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy