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

Hibernate example source code file (MyOid.java)

This example Hibernate source code file (MyOid.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

io, myoid, myoid, serializable, serializable

The Hibernate MyOid.java source code

//$Id$
package org.hibernate.test.annotations.type;
import java.io.Serializable;

/**
 * @author Emmanuel Bernard
 */
public class MyOid implements Serializable {
	private int high;
	private int middle;
	private int low;
	private int other;

	protected MyOid() {
	}

	public MyOid(int aHigh, int aMiddle, int aLow, int aOther) {
		high = aHigh;
		middle = aMiddle;
		low = aLow;
		other = aOther;
	}

	public int getHigh() {
		return high;
	}

	public void setHigh(int aHigh) {
		high = aHigh;
	}

	public int getMiddle() {
		return middle;
	}

	public void setMiddle(int aMiddle) {
		middle = aMiddle;
	}

	public int getLow() {
		return low;
	}

	public void setLow(int aLow) {
		low = aLow;
	}

	public int getOther() {
		return other;
	}

	public void setOther(int aOther) {
		other = aOther;
	}

	public boolean equals(Object o) {
		if ( this == o ) return true;
		if ( o == null || getClass() != o.getClass() ) return false;

		final MyOid myOid = (MyOid) o;

		if ( high != myOid.high ) return false;
		if ( low != myOid.low ) return false;
		if ( middle != myOid.middle ) return false;
		if ( other != myOid.other ) return false;

		return true;
	}

	public int hashCode() {
		int result;
		result = low;
		result = 29 * result + middle;
		result = 29 * result + high;
		result = 29 * result + other;
		return result;
	}
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate MyOid.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.