001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.kew.doctype;
017
018import java.io.Serializable;
019
020import javax.persistence.Column;
021import javax.persistence.Embeddable;
022
023/**
024 * This Compound Primary Class has been generated by the rice ojb2jpa Groovy script.  Please
025 * note that there are no setter methods, only getters.  This is done purposefully as cpk classes
026 * can not change after they have been created.  Also note they require a public no-arg constructor.
027 * TODO: Implement the equals() and hashCode() methods. 
028 */
029@Embeddable
030public class DocumentTypePolicyId implements Serializable {
031
032    private static final long serialVersionUID = -8024479878884387727L;
033        
034    @Column(name="DOC_TYP_ID")
035    private String documentTypeId;
036    @Column(name="DOC_PLCY_NM")
037    private String policyName;
038
039    public DocumentTypePolicyId() {}
040
041    public String getDocumentTypeId() { return documentTypeId; }
042    
043    public void setDocumentTypeId(String documentTypeId) { this.documentTypeId = documentTypeId; }
044
045    public String getPolicyName() { return policyName; }
046
047    public void setPolicyName(String policyName) { this.policyName = policyName; }
048    
049        /**
050         * This overridden method ...
051         * 
052         * @see java.lang.Object#hashCode()
053         */
054        @Override
055        public int hashCode() {
056                final int prime = 31;
057                int result = 1;
058                result = prime
059                                * result
060                                + ((this.documentTypeId == null) ? 0 : this.documentTypeId
061                                                .hashCode());
062                result = prime * result
063                                + ((this.policyName == null) ? 0 : this.policyName.hashCode());
064                return result;
065        }
066
067        /**
068         * This overridden method ...
069         * 
070         * @see java.lang.Object#equals(java.lang.Object)
071         */
072        @Override
073        public boolean equals(Object obj) {
074                if (this == obj)
075                        return true;
076                if (obj == null)
077                        return false;
078                if (getClass() != obj.getClass())
079                        return false;
080                final DocumentTypePolicyId other = (DocumentTypePolicyId) obj;
081                if (this.documentTypeId == null) {
082                        if (other.documentTypeId != null)
083                                return false;
084                } else if (!this.documentTypeId.equals(other.documentTypeId))
085                        return false;
086                if (this.policyName == null) {
087                        if (other.policyName != null)
088                                return false;
089                } else if (!this.policyName.equals(other.policyName))
090                        return false;
091                return true;
092        }
093
094}
095