1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.mycore.backend.jpa.access;
20
21 import java.io.Serializable;
22
23 import jakarta.persistence.Column;
24 import jakarta.persistence.Embeddable;
25
26 @Embeddable
27 public class MCRACCESSPK implements Serializable {
28
29 private static final long serialVersionUID = 1177905976922683366L;
30
31 @Column(name = "ACPOOL")
32 private String acpool;
33
34 @Column(name = "OBJID")
35 private String objid;
36
37 public MCRACCESSPK() {
38 }
39
40 public MCRACCESSPK(String acpool, String objid) {
41 this.acpool = acpool;
42 this.objid = objid;
43 }
44
45 public String getAcpool() {
46 return acpool;
47 }
48
49 public void setAcpool(String acpool) {
50 this.acpool = acpool;
51 }
52
53 public String getObjid() {
54 return objid;
55 }
56
57 public void setObjid(String objid) {
58 this.objid = objid;
59 }
60
61
62
63
64 @Override
65 public int hashCode() {
66 final int prime = 31;
67 int result = 1;
68 result = prime * result + (acpool == null ? 0 : acpool.hashCode());
69 result = prime * result + (objid == null ? 0 : objid.hashCode());
70 return result;
71 }
72
73
74
75
76 @Override
77 public boolean equals(Object obj) {
78 if (this == obj) {
79 return true;
80 }
81 if (obj == null) {
82 return false;
83 }
84 if (getClass() != obj.getClass()) {
85 return false;
86 }
87 final MCRACCESSPK other = (MCRACCESSPK) obj;
88 if (acpool == null) {
89 if (other.acpool != null) {
90 return false;
91 }
92 } else if (!acpool.equals(other.acpool)) {
93 return false;
94 }
95 if (objid == null) {
96 return other.objid == null;
97 } else {
98 return objid.equals(other.objid);
99 }
100 }
101
102 }