001: /***********************************************************************************************************************************
002: **
003: ** Research In Motion. Do not reproduce without permission in writing.
004: **
005: ** Copyright (c) 2006 Research In Motion.
006: ** All rights reserved.
007: **
008: ************************************************************************************************************************************
009: */package org.jboss.ejb3.test.timestampentity.entity;
010:
011: import javax.persistence.Embeddable;
012:
013: /***********************************************************************************************************************************
014: **
015: ** This is a primary key class for the BMSTable1 table...Generated 27-Nov-2006 9:48:27 AM by Hibernate Tools 3.2.0.beta7
016: **
017: ** @author jgrills
018: ** @version T.B.D
019: **
020: ************************************************************************************************************************************
021: */
022: @Embeddable
023: public class Table1Key implements java.io.Serializable {
024:
025: /***********************************************************************************************************************************
026: **
027: ** The locale identifer
028: **
029: ************************************************************************************************************************************
030: */
031: private String _keyField1;
032:
033: /***********************************************************************************************************************************
034: **
035: ** The plugin identifier
036: **
037: ************************************************************************************************************************************
038: */
039: private int _keyField2;
040:
041: /***********************************************************************************************************************************
042: **
043: ** The string identifier
044: **
045: ************************************************************************************************************************************
046: */
047: private String _keyField3;
048:
049: /***********************************************************************************************************************************
050: **
051: ** The default constructor for a Table1 primary key
052: **
053: ************************************************************************************************************************************
054: */
055: public Table1Key() {
056:
057: }
058:
059: /***********************************************************************************************************************************
060: **
061: ** The full constructor for a Table1 primary key
062: **
063: ** @param keyField1 the localeIdentifier
064: ** @param keyField2 the localeIdentifier
065: ** @param keyField3 the localeIdentifier
066: **
067: ************************************************************************************************************************************
068: */
069: public Table1Key(String keyField1, int keyField2, String keyField3) {
070:
071: _keyField1 = keyField1;
072: _keyField2 = keyField2;
073: _keyField3 = keyField3;
074: }
075:
076: /***********************************************************************************************************************************
077: **
078: ** The get method for the keyField1 identifier
079: **
080: ** @return the keyField1 identifier
081: **
082: ************************************************************************************************************************************
083: */
084: public String getKeyField1() {
085:
086: return _keyField1;
087: }
088:
089: /***********************************************************************************************************************************
090: **
091: ** The set method for the keyField1 identifier
092: **
093: ** @param keyField1 the keyField1 identifier
094: **
095: ************************************************************************************************************************************
096: */
097: public void setKeyField1(String keyField1) {
098:
099: _keyField1 = keyField1;
100: }
101:
102: /***********************************************************************************************************************************
103: **
104: ** The get method for the keyField2 identifier
105: **
106: ** @return the keyField2 identifier
107: **
108: ************************************************************************************************************************************
109: */
110: public int getKeyField2() {
111:
112: return _keyField2;
113: }
114:
115: /***********************************************************************************************************************************
116: **
117: ** The set method for the keyField2 identifier
118: **
119: ** @param keyField2 the keyField2 identifier
120: **
121: ************************************************************************************************************************************
122: */
123: public void setKeyField2(int keyField2) {
124:
125: _keyField2 = keyField2;
126: }
127:
128: /***********************************************************************************************************************************
129: **
130: ** The get method for the keyField3 identifier
131: **
132: ** @return the keyField3 identifier
133: **
134: ************************************************************************************************************************************
135: */
136: public String getKeyField3() {
137:
138: return _keyField3;
139: }
140:
141: /***********************************************************************************************************************************
142: **
143: ** The set method for the keyField3 identifier
144: **
145: ** @param keyField3 the keyField3 identifier
146: **
147: ************************************************************************************************************************************
148: */
149: public void setKeyField3(String keyField3) {
150:
151: _keyField3 = keyField3;
152: }
153:
154: /***********************************************************************************************************************************
155: **
156: ** The primary key class' equals method
157: **
158: ** @param other a comparison object
159: **
160: ************************************************************************************************************************************
161: */
162: public boolean equals(Object other) {
163:
164: if ((this == other))
165: return true;
166: if ((other == null))
167: return false;
168: if (!(other instanceof Table1Key))
169: return false;
170: Table1Key castOther = (Table1Key) other;
171:
172: return ((this .getKeyField1() == castOther.getKeyField1()) || (this
173: .getKeyField1() != null
174: && castOther.getKeyField1() != null && this
175: .getKeyField1().equals(castOther.getKeyField1())))
176: && (this .getKeyField2() == castOther.getKeyField2())
177: && ((this .getKeyField3() == castOther.getKeyField3()) || (this
178: .getKeyField3() != null
179: && castOther.getKeyField3() != null && this
180: .getKeyField3()
181: .equals(castOther.getKeyField3())));
182: }
183:
184: /***********************************************************************************************************************************
185: **
186: ** The primary key class' hashCode method
187: **
188: ************************************************************************************************************************************
189: */
190: public int hashCode() {
191:
192: int result = 17;
193:
194: result = 37
195: * result
196: + (getKeyField1() == null ? 0 : this .getKeyField1()
197: .hashCode());
198: result = 37 * result + this .getKeyField2();
199: result = 37
200: * result
201: + (getKeyField3() == null ? 0 : this.getKeyField3()
202: .hashCode());
203: return result;
204: }
205: }
|