01: //$Id: Simple.java 7 2007-08-17 19:32:18Z jcamaia $
02:
03: package net.sf.persist.tests.common;
04:
05: import net.sf.persist.annotations.Column;
06:
07: public class Simple {
08:
09: private long id;
10: private String stringCol;
11: private long intCol;
12:
13: @Column(autoGenerated=true)
14: public long getId() {
15: return id;
16: }
17:
18: public void setId(long id) {
19: this .id = id;
20: }
21:
22: public String getStringCol() {
23: return stringCol;
24: }
25:
26: public void setStringCol(String stringCol) {
27: this .stringCol = stringCol;
28: }
29:
30: public long getIntCol() {
31: return intCol;
32: }
33:
34: public void setIntCol(long intCol) {
35: this .intCol = intCol;
36: }
37:
38: @Override
39: public boolean equals(Object obj) {
40: if (this == obj)
41: return true;
42: if (obj == null)
43: return false;
44: if (getClass() != obj.getClass())
45: return false;
46:
47: final Simple other = (Simple) obj;
48:
49: // do not compare ids -- will be tested in the autogeneratedkeys tests
50: // if (id != other.id) return false;
51:
52: if (intCol != other.intCol)
53: return false;
54: if (stringCol == null) {
55: if (other.stringCol != null)
56: return false;
57: } else if (!stringCol.equals(other.stringCol))
58: return false;
59:
60: return true;
61: }
62:
63: public String toString() {
64: return "id=" + id + " intCol=" + intCol + " stringCol="
65: + stringCol;
66: }
67:
68: }
|