1 package myorg.relex.collection;
2
3
4 import javax.persistence.*;
5
6
7
8
9
10
11
12
13 @Entity
14 @Table(name="RELATIONEX_SHIP")
15 public class ShipBySwitch extends Ship {
16 @Override
17 public int peekHashCode() {
18 return id==0 ? super.objectHashCode() : id;
19 }
20
21 @Override
22 public boolean equals(Object obj) {
23 try {
24 if (this == obj) { return logEquals(obj, true); }
25 boolean equals = (id==0) ? super.equals(obj) :
26 id==((ShipBySwitch)obj).id;
27 return logEquals(obj, equals);
28 } catch (Exception ex) {
29 return logEquals(obj, false);
30 }
31 }
32 }