alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (VersionsJoinTableRangeTestEntitySuperClass.java)

This example Hibernate source code file (VersionsJoinTableRangeTestEntitySuperClass.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

generatedvalue, id, integer, integer, mappedsuperclass, override, override, string, string, versionsjointablerangetestentitysuperclass, versionsjointablerangetestentitysuperclass

The Hibernate VersionsJoinTableRangeTestEntitySuperClass.java source code

package org.hibernate.envers.test.integration.naming;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * Mapped superclass for Audit join table test.
 * 
 * @author Erik-Berndt Scheper
 */
@MappedSuperclass
@org.hibernate.envers.Audited
public abstract class VersionsJoinTableRangeTestEntitySuperClass {

	@Id
	@GeneratedValue
	private Integer id;

	private String genericValue;

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	protected void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the genericValue
	 */
	public String getGenericValue() {
		return genericValue;
	}

	/**
	 * @param genericValue
	 *            the genericValue to set
	 */
	public void setGenericValue(String genericValue) {
		this.genericValue = genericValue;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((genericValue == null) ? 0 : genericValue.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		VersionsJoinTableRangeTestEntitySuperClass other = (VersionsJoinTableRangeTestEntitySuperClass) obj;
		if (genericValue == null) {
			if (other.genericValue != null)
				return false;
		} else if (!genericValue.equals(other.genericValue))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate VersionsJoinTableRangeTestEntitySuperClass.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.