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 javax.persistence.Column; 019import javax.persistence.Embeddable; 020import java.io.Serializable; 021 022/** 023 * Composite primary key for {@link ApplicationDocumentStatus}. 024 * 025 * @author Kuali Rice Team (rice.collab@kuali.org) 026 */ 027@Embeddable 028public class ApplicationDocumentStatusId implements Serializable { 029 030 @Column(name="DOC_TYP_ID", nullable = false) 031 private String documentTypeId; 032 @Column(name="DOC_STAT_NM", nullable = false) 033 private String statusName; 034 035 public String getDocumentTypeId() { 036 return documentTypeId; 037 } 038 039 public void setDocumentTypeId(String documentTypeId) { 040 this.documentTypeId = documentTypeId; 041 } 042 043 public String getStatusName() { 044 return statusName; 045 } 046 047 public void setStatusName(String statusName) { 048 this.statusName = statusName; 049 } 050 051 @Override 052 public int hashCode() { 053 final int prime = 31; 054 int result = 1; 055 result = prime 056 * result 057 + ((this.documentTypeId == null) ? 0 : this.documentTypeId 058 .hashCode()); 059 result = prime * result 060 + ((this.statusName == null) ? 0 : this.statusName.hashCode()); 061 return result; 062 } 063 064 @Override 065 public boolean equals(Object obj) { 066 if (this == obj) 067 return true; 068 if (obj == null) 069 return false; 070 if (getClass() != obj.getClass()) 071 return false; 072 final ApplicationDocumentStatusId other = (ApplicationDocumentStatusId) obj; 073 if (this.documentTypeId == null) { 074 if (other.documentTypeId != null) 075 return false; 076 } else if (!this.documentTypeId.equals(other.documentTypeId)) 077 return false; 078 if (this.statusName == null) { 079 if (other.statusName != null) 080 return false; 081 } else if (!this.statusName.equals(other.statusName)) 082 return false; 083 return true; 084 } 085 086} 087