01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: AReallyObnoxiouslyLongWindedNamedObject.java,v 1.3 2002/11/08 05:06:26 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.test;
12:
13: /**
14: * A test object using Java identifiers intentionally chosen to overflow
15: * Oracle's identifier limits.
16: *
17: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
18: * @version $Revision: 1.3 $
19: */
20:
21: class AReallyObnoxiouslyLongWindedNamedObject extends KeywordConflict {
22: private KeywordConflict aReallyObnoxiouslyLongWindedNamedField;
23:
24: public AReallyObnoxiouslyLongWindedNamedObject() {
25: super ();
26: }
27:
28: /**
29: * Fills all of the object's fields with random data values. Any non-
30: * primitive fields (with the exception of <code>id</code>) will also be
31: * assigned <code>null</code> on a random basis.
32: */
33:
34: public void fillRandom() {
35: super .fillRandom();
36:
37: aReallyObnoxiouslyLongWindedNamedField = null;
38: }
39:
40: /**
41: * Indicates whether some other object is "equal to" this one. By comparing
42: * against an original copy of the object, <code>compareTo()</code> can be
43: * used to verify that the object has been written to a database and read
44: * back correctly.
45: *
46: * @param obj the reference object with which to compare
47: *
48: * @return <code>true</code> if this object is equal to the obj argument;
49: * <code>false</code> otherwise.
50: */
51:
52: public boolean compareTo(Object obj) {
53: if (obj == this )
54: return true;
55:
56: if (!(obj instanceof AReallyObnoxiouslyLongWindedNamedObject)
57: || !super .compareTo(obj))
58: return false;
59:
60: AReallyObnoxiouslyLongWindedNamedObject o = (AReallyObnoxiouslyLongWindedNamedObject) obj;
61:
62: return aReallyObnoxiouslyLongWindedNamedField == o.aReallyObnoxiouslyLongWindedNamedField;
63: }
64:
65: /**
66: * Returns a string representation for this object. All of the field
67: * values are included in the string for debugging purposes.
68: *
69: * @return a string representation for this object.
70: */
71:
72: public String toString() {
73: StringBuffer s = new StringBuffer(super .toString());
74:
75: s.append(" aReallyObnoxiouslyLongWindedNamedField = ").append(
76: aReallyObnoxiouslyLongWindedNamedField);
77: s.append('\n');
78:
79: return s.toString();
80: }
81: }
|