View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.impl.repository;
17  
18  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Entity;
22  import javax.persistence.GeneratedValue;
23  import javax.persistence.Id;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.ManyToOne;
26  import javax.persistence.Table;
27  import javax.persistence.Transient;
28  import java.io.Serializable;
29  
30  @Entity
31  @Table(name = "KRMS_CNTXT_VLD_TERM_SPEC_T")
32  public class ContextValidTermBo implements Serializable {
33  
34      private static final long serialVersionUID = 1l;
35  
36      @PortableSequenceGenerator(name = "KRMS_CNTXT_VLD_TERM_SPEC_S")
37      @GeneratedValue(generator = "KRMS_CNTXT_VLD_TERM_SPEC_S")
38      @Id
39      @Column(name = "CNTXT_TERM_SPEC_PREREQ_ID")
40      private String id;
41  
42      @Column(name = "CNTXT_ID")
43      private String contextId;
44  
45      @Transient
46      private Boolean prereq;
47  
48      @ManyToOne()
49      @JoinColumn(name = "TERM_SPEC_ID", referencedColumnName = "TERM_SPEC_ID")
50      private TermSpecificationBo termSpecification;
51  
52      public String getId() {
53          return id;
54      }
55  
56      public void setId(String id) {
57          this.id = id;
58      }
59  
60      public String getContextId() {
61          return contextId;
62      }
63  
64      public void setContextId(String contextId) {
65          this.contextId = contextId;
66      }
67  
68      public String getTermSpecificationId() {
69          if (termSpecification != null) {
70              return termSpecification.getId();
71          }
72  
73          return null;
74      }
75  
76      public Boolean getPrereq() {
77          return prereq;
78      }
79  
80      public void setPrereq(Boolean prereq) {
81          this.prereq = prereq;
82      }
83  
84      public TermSpecificationBo getTermSpecification() {
85          return termSpecification;
86      }
87  
88      public void setTermSpecification(TermSpecificationBo termSpecification) {
89          this.termSpecification = termSpecification;
90      }
91  }