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 org.kuali.rice.kew.doctype.bo.DocumentType;
019import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
020
021import javax.persistence.EmbeddedId;
022import javax.persistence.Entity;
023import javax.persistence.JoinColumn;
024import javax.persistence.ManyToOne;
025import javax.persistence.MapsId;
026import javax.persistence.Table;
027import javax.persistence.Transient;
028
029/**
030 * <p>Model bean representing a grouping of valid application document statuses for a document type
031 * An instance of this class represents a subset of the valid status for a given document type.
032 * </p>
033 * <p>The purpose of the Application Document Status Category is to provide a grouping mechanism
034 * for Application Document Status that can be used to not only label a set of statuses as having some common
035 * characteristic, but to allow users to search on all the grouped statuses by selecting the category name.
036 * </p>
037 * <p>The (optional) valid application statuses element within a document type definition may (again, optionally)
038 * contain
039 * category elements which define these groupings of valid statuses.
040 * </p>
041 *
042 * @author Kuali Rice Team (rice.collab@kuali.org)
043 */
044@Entity
045@Table(name = "KREW_DOC_TYP_APP_STAT_CAT_T")
046public class ApplicationDocumentStatusCategory extends PersistableBusinessObjectBase {
047
048    private static final long serialVersionUID = -2212481684546954746L;
049
050    @EmbeddedId
051    private ApplicationDocumentStatusCategoryId applicationDocumentStatusCategoryId;
052
053    @MapsId("documentTypeId")
054    @ManyToOne
055    @JoinColumn(name = "DOC_TYP_ID")
056    private DocumentType documentType;
057
058    @Deprecated
059    @Transient
060    private String documentTypeId;
061
062    @Deprecated
063    @Transient
064    private String categoryName;
065
066    /**
067     * Gets the composite identifier, a {@link org.kuali.rice.kew.doctype.ApplicationDocumentStatusCategoryId}
068     *
069     * @return the application document status category id
070     */
071    public ApplicationDocumentStatusCategoryId getApplicationDocumentStatusCategoryId() {
072        if (this.applicationDocumentStatusCategoryId == null) {
073            this.applicationDocumentStatusCategoryId = new ApplicationDocumentStatusCategoryId();
074        }
075        return this.applicationDocumentStatusCategoryId;
076    }
077
078    /**
079     * Sets the composition identifier
080     *
081     * @param categoryId the composite identifier to set
082     */
083    public void setApplicationDocumentStatusCategoryId(ApplicationDocumentStatusCategoryId categoryId) {
084        this.applicationDocumentStatusCategoryId = categoryId;
085    }
086
087    /**
088     * Get the document type id for this category
089     *
090     * @return the document type id
091     */
092    public String getDocumentTypeId() {
093        return this.getApplicationDocumentStatusCategoryId().getDocumentTypeId();
094    }
095
096    /**
097     * Set the document type id for this category
098     *
099     * @param documentTypeId the document type id to set
100     */
101    public void setDocumentTypeId(String documentTypeId) {
102        this.getApplicationDocumentStatusCategoryId().setDocumentTypeId(documentTypeId);
103    }
104
105    /**
106     * The name for this category
107     *
108     * @return the category name
109     */
110    public String getCategoryName() {
111        return this.getApplicationDocumentStatusCategoryId().getCategoryName();
112    }
113
114    /**
115     * Set the name for this category
116     *
117     * @param statusName the category name to set
118     */
119    public void setCategoryName(String statusName) {
120        this.getApplicationDocumentStatusCategoryId().setCategoryName(statusName);
121    }
122
123    public DocumentType getDocumentType() {
124        return documentType;
125    }
126
127    public void setDocumentType(DocumentType documentType) {
128        this.documentType = documentType;
129    }
130}