1 /**
2 * Copyright 2005-2014 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.bo;
17
18 import org.apache.commons.lang.builder.HashCodeBuilder;
19
20 import javax.persistence.Column;
21 import javax.persistence.Id;
22 import java.io.Serializable;
23
24 /**
25 * This Compound Primary Class has been generated by the rice ojb2jpa Groovy script. Please
26 * note that there are no setter methods, only getters. This is done purposefully as cpk classes
27 * can not change after they have been created. Also note they require a public no-arg constructor.
28 */
29 public class AdHocRouteWorkgroupId implements Serializable {
30
31 private static final long serialVersionUID = -3782889247235043846L;
32
33 @Column(name="RECIP_TYP_CD")
34 private Integer type;
35 @Id
36 @Column(name="ACTN_RQST_CD")
37 private String actionRequested;
38 @Id
39 @Column(name="ACTN_RQST_RECIP_ID")
40 private String id;
41
42 /**
43 * Default constructor.
44 */
45 public AdHocRouteWorkgroupId() {}
46
47 /**
48 * Sets property values.
49 *
50 * @param type ad hoc type identifier
51 * @param actionRequested action requested
52 * @param id unique identifier
53 */
54 public AdHocRouteWorkgroupId(Integer type, String actionRequested, String id) {
55 this.type = type;
56 this.actionRequested = actionRequested;
57 this.id = id;
58 }
59
60 /**
61 * Gets the type identifier.
62 *
63 * @return type identifier
64 */
65 public Integer getType() {
66 return this.type;
67 }
68
69 /**
70 * Gets the action requested.
71 *
72 * @return action requested.
73 */
74 public String getActionRequested() {
75 return this.actionRequested;
76 }
77
78 /**
79 * Gets the unique identifier.
80 *
81 * @return unique identifier
82 */
83 public String getId() {
84 return this.id;
85 }
86
87 @Override
88 public boolean equals(Object o) {
89 if (o == this) return true;
90 if (!(o instanceof AdHocRouteWorkgroupId)) return false;
91 if (o == null) return false;
92 AdHocRouteWorkgroupId pk = (AdHocRouteWorkgroupId) o;
93 return getType() != null && getActionRequested() != null && getId() != null && getType().equals(pk.getType()) && getActionRequested().equals(pk.getActionRequested()) && getId().equals(pk.getId());
94 }
95
96 @Override
97 public int hashCode() {
98 return new HashCodeBuilder().append(type).append(actionRequested).append(id).toHashCode();
99 }
100
101 }
102