FileDocCategorySizeDatePackage
Foo.javaAPI DocHibernate 3.2.59758Sun Sep 26 00:18:28 BST 2004org.hibernate.test.legacy

Foo

public class Foo extends Object implements Serializable, FooProxy, org.hibernate.classic.Lifecycle

Fields Summary
private static int
count
String
key
FooProxy
_foo
String
_string
Date
_date
Date
_timestamp
Integer
_integer
Long
_long
Short
_short
Float
_float
Double
_double
Boolean
_boolean
Byte
_byte
Integer
_null
int
_int
boolean
_bool
float
_zero
byte[]
_bytes
boolean
yesno
Serializable
blob
Serializable
nullBlob
byte[]
binary
String[]
custom
FooComponent
component
char
_char
Fee
dependent
Locale
theLocale
private int
version
private Timestamp
versionTimestamp
private Calendar
versionCalendar
private float
formula
private String
joinedProp
private int
x
Constructors Summary
public Foo()

	
public Foo(int x)

		this.x=x;
	
Methods Summary
public voiddisconnect()

		if ( _foo!=null) _foo.disconnect();
		_foo=null;
	
public booleanequalsFoo(org.hibernate.test.legacy.Foo other)

		if ( _bytes!=other._bytes ) {
			if ( _bytes==null || other._bytes==null ) return false;
			if ( _bytes.length!=other._bytes.length ) return false;
			for ( int i=0; i< _bytes.length; i++) {
				if ( _bytes[i] != other._bytes[i] ) return false;
			}
		}

		return ( this._bool == other._bool )
		&& ( ( this._boolean == other._boolean ) || ( this._boolean.equals(other._boolean) ) )
		&& ( ( this._byte == other._byte ) || ( this._byte.equals(other._byte) ) )
		//&& ( ( this._date == other._date ) || ( this._date.getDate() == other._date.getDate() && this._date.getMonth() == other._date.getMonth() && this._date.getYear() == other._date.getYear() ) )
		&& ( ( this._double == other._double ) || ( this._double.equals(other._double) ) )
		&& ( ( this._float == other._float ) || ( this._float.equals(other._float) ) )
		&& ( this._int == other._int )
		&& ( ( this._integer == other._integer ) || ( this._integer.equals(other._integer) ) )
		&& ( ( this._long == other._long ) || ( this._long.equals(other._long) ) )
		&& ( this._null == other._null )
		&& ( ( this._short == other._short ) || ( this._short.equals(other._short) ) )
		&& ( ( this._string == other._string) || ( this._string.equals(other._string) ) )
		//&& ( ( this._timestamp==other._timestamp) || ( this._timestamp.getDate() == other._timestamp.getDate() && this._timestamp.getYear() == other._timestamp.getYear() && this._timestamp.getMonth() == other._timestamp.getMonth() ) )
		&& ( this._zero == other._zero )
		&& ( ( this._foo == other._foo ) || ( this._foo.getKey().equals( other._foo.getKey() ) ) )
		&& ( ( this.blob == other.blob ) || ( this.blob.equals(other.blob) ) )
		&& ( this.yesno == other.yesno )
		&& ( ( this.binary == other.binary ) || java.util.Arrays.equals(this.binary, other.binary) )
		&& ( this.key.equals(other.key) )
		&& ( this.theLocale.equals(other.theLocale) )
		&& ( ( this.custom == other.custom ) || ( this.custom[0].equals(other.custom[0]) && this.custom[1].equals(other.custom[1]) ) );

	
public voidfinalize()

 
public byte[]getBinary()

		return binary;
	
public java.io.SerializablegetBlob()

		return blob;
	
public booleangetBool()

		return _bool;
	
public java.lang.BooleangetBoolean()

		return _boolean;
	
public java.lang.BytegetByte()

		return _byte;
	
public byte[]getBytes()

		return _bytes;
	
public java.lang.CharactergetChar()

		return new Character(_char);
	
public FooComponentgetComponent()

		return component;
	
public java.lang.String[]getCustom()

		return custom;
	
public java.util.DategetDate()

		return _date;
	
public FeegetDependent()

		return dependent;
	
public java.lang.DoublegetDouble()

		return _double;
	
public java.lang.FloatgetFloat()

		return _float;
	
public FooProxygetFoo()

		return _foo;
	
public floatgetFormula()

		return formula;
	
public intgetInt()

		return _int;
	
public java.lang.IntegergetInteger()

		return _integer;
	
public java.lang.StringgetJoinedProp()

return
Returns the joinedProp.

		return joinedProp;
	
public java.lang.StringgetKey()

		return key;
	
public java.util.LocalegetLocale()
Returns the locale.

return
Locale

		return theLocale;
	
public java.lang.LonggetLong()

		return _long;
	
public java.lang.IntegergetNull()

		return _null;
	
public java.io.SerializablegetNullBlob()

		return nullBlob;
	
public FooComponentgetNullComponent()

		return null;
	
public java.lang.ShortgetShort()

		return _short;
	
public java.lang.StringgetString()

		return _string;
	
public java.util.DategetTimestamp()

		return _timestamp;
	
public intgetVersion()
Returns the version.

return
int

		return version;
	
public java.util.CalendargetVersionCalendar()

		return versionCalendar;
	
public java.sql.TimestampgetVersionTimestamp()
Returns the versionTimestamp.

return
Timestamp

		return versionTimestamp;
	
public intgetX()

		return x;
	
public booleangetYesno()

		return yesno;
	
public floatgetZero()

		return _zero;
	
public booleanonDelete(org.hibernate.Session db)

		return NO_VETO;
	
public voidonLoad(org.hibernate.Session db, java.io.Serializable id)

	
public booleanonSave(org.hibernate.Session db)

		_string = "a string";
		_date = new Date(123);
		_timestamp = new Date( System.currentTimeMillis() );
		_integer = new Integer( -666 );
		_long = new Long( 696969696969696969l - count++ );
		_short = new Short("42");
		_float = new Float( 6666.66f );
		//_double = new Double( 1.33e-69 );  // this double is too big for the sap db jdbc driver
		_double = new Double( 1.12e-36 );
		_boolean = new Boolean(true);
		_byte = new Byte( (byte) 127 );
		_int = 2;
		_char = '@";
		_bytes = _string.getBytes();
		Struct s = new Struct();
		s.name="name";
		s.count = 69;
		blob = s;
		binary = ( _string + "yada yada yada" ).getBytes();
		custom = new String[] { "foo", "bar" };
		component = new FooComponent("foo", 12, new Date[] { _date, _timestamp, null, new Date() }, new FooComponent("bar", 666, new Date[] { new Date(123456l), null }, null ) );
		component.setGlarch( new Glarch() );
		dependent = new Fee();
		dependent.setFi( "belongs to foo # " + getKey() );
		theLocale = Locale.getDefault();
		return NO_VETO;
	
public booleanonUpdate(org.hibernate.Session db)

		return NO_VETO;
	
public voidsetBinary(byte[] binary)

		this.binary = binary;
	
public voidsetBlob(java.io.Serializable blob)

		this.blob = blob;
	
public voidsetBool(boolean bool)

		_bool = bool;
	
public voidsetBoolean(java.lang.Boolean bboolean)

		_boolean = bboolean;
	
public voidsetByte(java.lang.Byte bbyte)

		_byte = bbyte;
	
public voidsetBytes(byte[] bytes)

		_bytes = bytes;
	
public voidsetChar(java.lang.Character _char)

		this._char = _char.charValue();
	
public voidsetComponent(FooComponent component)

		this.component = component;
	
public voidsetCustom(java.lang.String[] custom)

		this.custom = custom;
	
public voidsetDate(java.util.Date date)

		_date = date;
	
public voidsetDependent(Fee dependent)

		this.dependent = dependent;
	
public voidsetDouble(java.lang.Double ddouble)

		_double = ddouble;
	
public voidsetFloat(java.lang.Float ffloat)

		_float = ffloat;
	
public voidsetFoo(FooProxy foo)

		_foo = foo;
	
public voidsetFormula(float f)

		formula = f;
	
public voidsetInt(int iint)

		_int = iint;
	
public voidsetInteger(java.lang.Integer iinteger)

		_integer = iinteger;
	
public voidsetJoinedProp(java.lang.String joinedProp)

param
joinedProp The joinedProp to set.

		this.joinedProp = joinedProp;
	
public voidsetKey(java.lang.String key)

		this.key = key;
	
public voidsetLocale(java.util.Locale locale)
Sets the locale.

param
locale The locale to set

		this.theLocale = locale;
	
public voidsetLong(java.lang.Long llong)

		_long = llong;
	
public voidsetNull(java.lang.Integer nnull)

		_null = nnull;
	
public voidsetNullBlob(java.io.Serializable nullBlob)

		this.nullBlob = nullBlob;
	
public voidsetNullComponent(FooComponent fc)

		if (fc!=null) throw new Exception("Null component");
	
public voidsetShort(java.lang.Short sshort)

		_short = sshort;
	
public voidsetString(java.lang.String string)

		_string = string;
		//if (_foo!=null) _foo.setString(string);
	
public voidsetTimestamp(java.util.Date timestamp)

		_timestamp = timestamp;
	
public voidsetVersion(int version)
Sets the version.

param
version The version to set

		this.version = version;
	
public voidsetVersionCalendar(java.util.Calendar calendar)

		versionCalendar = calendar;
	
public voidsetVersionTimestamp(java.sql.Timestamp versionTimestamp)
Sets the versionTimestamp.

param
versionTimestamp The versionTimestamp to set

		this.versionTimestamp = versionTimestamp;
	
public voidsetX(int x)

		this.x = x;
	
public voidsetYesno(boolean yesno)

		this.yesno = yesno;
	
public voidsetZero(float zero)

		_zero = zero;
	
public java.lang.StringtoString()

		return this.getClass().getName() + ": " + key;