This project has retired. For details please refer to its
Attic page.
TempKeyPK xref
1 package org.apache.juddi.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 import javax.persistence.Column;
19 import javax.persistence.Embeddable;
20
21 import org.apache.commons.lang.builder.HashCodeBuilder;
22
23
24
25
26
27 @Embeddable
28 public class TempKeyPK implements java.io.Serializable {
29
30 private static final long serialVersionUID = 790951819871694597L;
31 private String entityKey;
32 private String txId;
33
34 public TempKeyPK(){
35 }
36
37 @Column(name = "entity_key", nullable = false, length = 255)
38 public String getEntityKey() {
39 return entityKey;
40 }
41 public void setEntityKey(String entityKey) {
42 this.entityKey = entityKey;
43 }
44
45 @Column(name = "tx_id", nullable = false, length = 255)
46 public String getTxId() {
47 return txId;
48 }
49 public void setTxId(String txId) {
50 this.txId = txId;
51 }
52
53 public int compareTo(TempKeyPK o) {
54 if (o==null || o.getEntityKey()==null || o.getTxId()==null) return 0;
55 if (o.getEntityKey().equals(getEntityKey()) && o.getTxId().equals(getTxId())) return 1;
56 else return 0;
57 }
58
59 @Override
60 public boolean equals(Object obj) {
61 if (obj!=null && obj instanceof TempKeyPK) {
62 int i = compareTo((TempKeyPK) obj);
63 if (i==1) return true;
64 else return false;
65 } else {
66 return false;
67 }
68 }
69
70 @Override
71 public int hashCode() {
72 return new HashCodeBuilder(17, 31).
73 append(getTxId()).
74 append(getEntityKey()).
75 toHashCode();
76 }
77 }
78
79