1 10 11 package com.triactive.jdo.test; 12 13 import javax.jdo.JDOHelper; 14 15 16 23 24 class KeywordConflict extends TestObject 25 { 26 private int column; 27 private int select; 28 private int where; 29 private int varchar; 30 private int decimal; 31 private int _leading; 32 private int trailing_; 33 private int _surrounding_; 34 35 36 public KeywordConflict() 37 { 38 super(); 39 } 40 41 42 public int getColumn() 43 { 44 return column; 45 } 46 47 48 public int getSelect() 49 { 50 return select; 51 } 52 53 54 public int getWhere() 55 { 56 return where; 57 } 58 59 60 public int getVarchar() 61 { 62 return varchar; 63 } 64 65 66 public int getDecimal() 67 { 68 return decimal; 69 } 70 71 72 public int getLeading() 73 { 74 return _leading; 75 } 76 77 78 public int getTrailing() 79 { 80 return trailing_; 81 } 82 83 84 public int getSurrounding() 85 { 86 return _surrounding_; 87 } 88 89 90 95 96 public void fillRandom() 97 { 98 column = r.nextInt(); 99 select = r.nextInt(); 100 where = r.nextInt(); 101 varchar = r.nextInt(); 102 decimal = r.nextInt(); 103 _leading = r.nextInt(); 104 trailing_ = r.nextInt(); 105 _surrounding_ = r.nextInt(); 106 } 107 108 109 120 121 public boolean compareTo(Object obj) 122 { 123 if (obj == this) 124 return true; 125 126 if (!(obj instanceof KeywordConflict)) 127 return false; 128 129 KeywordConflict kc = (KeywordConflict)obj; 130 131 return column == kc.column 132 && select == kc.select 133 && where == kc.where 134 && varchar == kc.varchar 135 && decimal == kc.decimal 136 && _leading == _leading 137 && trailing_ == trailing_ 138 && _surrounding_ == _surrounding_; 139 } 140 141 142 148 149 public String toString() 150 { 151 StringBuffer s = new StringBuffer (getClass().getName() + ":"); 152 153 s.append(" JVM id = ").append(System.identityHashCode(this)); 154 s.append('\n'); 155 s.append(" JDO id = ").append(JDOHelper.getObjectId(this)); 156 s.append('\n'); 157 s.append(" column = ").append(column); 158 s.append('\n'); 159 s.append(" select = ").append(select); 160 s.append('\n'); 161 s.append(" where = ").append(where); 162 s.append('\n'); 163 s.append(" varchar = ").append(varchar); 164 s.append('\n'); 165 s.append(" decimal = ").append(decimal); 166 s.append('\n'); 167 s.append(" _leading = ").append(_leading); 168 s.append('\n'); 169 s.append(" trailing_ = ").append(trailing_); 170 s.append('\n'); 171 s.append(" _surrounding_ = ").append(_surrounding_); 172 s.append('\n'); 173 174 return s.toString(); 175 } 176 } 177 | Popular Tags |