001/**
002 * Copyright 2005-2017 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.krms.impl.repository;
017
018import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
019
020import javax.persistence.Column;
021import javax.persistence.Entity;
022import javax.persistence.GeneratedValue;
023import javax.persistence.Id;
024import javax.persistence.JoinColumn;
025import javax.persistence.ManyToOne;
026import javax.persistence.Table;
027import javax.persistence.Transient;
028import java.io.Serializable;
029
030@Entity
031@Table(name = "KRMS_CNTXT_VLD_TERM_SPEC_T")
032public class ContextValidTermBo implements Serializable {
033
034    private static final long serialVersionUID = 1l;
035
036    @PortableSequenceGenerator(name = "KRMS_CNTXT_VLD_TERM_SPEC_S")
037    @GeneratedValue(generator = "KRMS_CNTXT_VLD_TERM_SPEC_S")
038    @Id
039    @Column(name = "CNTXT_TERM_SPEC_PREREQ_ID")
040    private String id;
041
042    @Column(name = "CNTXT_ID")
043    private String contextId;
044
045    @Transient
046    private Boolean prereq;
047
048    @ManyToOne()
049    @JoinColumn(name = "TERM_SPEC_ID", referencedColumnName = "TERM_SPEC_ID")
050    private TermSpecificationBo termSpecification;
051
052    public String getId() {
053        return id;
054    }
055
056    public void setId(String id) {
057        this.id = id;
058    }
059
060    public String getContextId() {
061        return contextId;
062    }
063
064    public void setContextId(String contextId) {
065        this.contextId = contextId;
066    }
067
068    public String getTermSpecificationId() {
069        if (termSpecification != null) {
070            return termSpecification.getId();
071        }
072
073        return null;
074    }
075
076    public Boolean getPrereq() {
077        return prereq;
078    }
079
080    public void setPrereq(Boolean prereq) {
081        this.prereq = prereq;
082    }
083
084    public TermSpecificationBo getTermSpecification() {
085        return termSpecification;
086    }
087
088    public void setTermSpecification(TermSpecificationBo termSpecification) {
089        this.termSpecification = termSpecification;
090    }
091}