001 /**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.krad.bo;
017
018 import org.apache.commons.lang.builder.HashCodeBuilder;
019
020 import javax.persistence.Column;
021 import javax.persistence.Id;
022 import java.io.Serializable;
023
024 /**
025 * This Compound Primary Class has been generated by the rice ojb2jpa Groovy script. Please
026 * note that there are no setter methods, only getters. This is done purposefully as cpk classes
027 * can not change after they have been created. Also note they require a public no-arg constructor.
028 * TODO: Implement the equals() and hashCode() methods.
029 */
030 public class AdHocRoutePersonId implements Serializable {
031
032 private static final long serialVersionUID = -2030160650786561367L;
033
034 @Column(name="RECIP_TYP_CD")
035 private Integer type;
036 @Id
037 @Column(name="ACTN_RQST_CD")
038 private String actionRequested;
039 @Id
040 @Column(name="ACTN_RQST_RECIP_ID")
041 private String id;
042
043 public AdHocRoutePersonId() {}
044
045 public AdHocRoutePersonId(Integer type, String actionRequested, String id) {
046 this.type = type;
047 this.actionRequested = actionRequested;
048 this.id = id;
049 }
050
051 public Integer getType() {
052 return this.type;
053 }
054
055 public String getActionRequested() {
056 return this.actionRequested;
057 }
058
059 public String getId() {
060 return this.id;
061 }
062
063 public boolean equals(Object o) {
064 if (o == this) return true;
065 if (!(o instanceof AdHocRoutePersonId)) return false;
066 if (o == null) return false;
067 AdHocRoutePersonId pk = (AdHocRoutePersonId) o;
068 return getType() != null && getActionRequested() != null && getId() != null && getType().equals(pk.getType()) && getActionRequested().equals(pk.getActionRequested()) && getId().equals(pk.getId());
069 }
070
071 public int hashCode() {
072 return new HashCodeBuilder().append(type).append(actionRequested).append(id).toHashCode();
073 }
074
075 }
076