/*
	cursus - Race series management program
	Copyright 2011  Simon Arlott

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package eu.lp0.cursus.db.data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class AbstractEntity {
	private long id;

	@Id
	@GeneratedValue
	@Column(nullable = false)
	public long getId() {
		return id;
	}

	@SuppressWarnings("unused")
	private void setId(long id) {
		this.id = id;
	}

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

		if (!getClass().equals(o.getClass())) {
			return false;
		}

		return new Long(getId()).equals(((AbstractEntity)o).getId());
	}

	@Override
	public int hashCode() {
		return (int)(id ^ (id >>> 32));
	}
}
@@ -1322,16 +1322,56 @@
 e;%0A%09%09%7D%0A%0A
+%09%09if (o == this) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%0A
 %09%09if (!g

check == first in equals()