View Javadoc
1   /**
2    * Copyright 2005-2014 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.FetchType;
23  import javax.persistence.GeneratedValue;
24  import javax.persistence.Id;
25  import javax.persistence.JoinColumn;
26  import javax.persistence.ManyToOne;
27  import javax.persistence.Table;
28  import javax.persistence.Transient;
29  import java.io.Serializable;
30  
31  @Entity
32  @Table(name = "KRMS_CNTXT_VLD_TERM_SPEC_T")
33  public class ContextValidTermBo implements Serializable {
34  
35      private static final long serialVersionUID = 1l;
36  
37      @PortableSequenceGenerator(name = "KRMS_CNTXT_VLD_TERM_SPEC_S")
38      @GeneratedValue(generator = "KRMS_CNTXT_VLD_TERM_SPEC_S")
39      @Id
40      @Column(name = "CNTXT_TERM_SPEC_PREREQ_ID")
41      private String id;
42  
43      @Column(name = "CNTXT_ID")
44      private String contextId;
45  
46      @Transient
47      private Boolean prereq;
48  
49      @ManyToOne(fetch = FetchType.LAZY)
50      @JoinColumn(name = "TERM_SPEC_ID", referencedColumnName = "TERM_SPEC_ID")
51      private TermSpecificationBo termSpecification;
52  
53      public String getId() {
54          return id;
55      }
56  
57      public void setId(String id) {
58          this.id = id;
59      }
60  
61      public String getContextId() {
62          return contextId;
63      }
64  
65      public void setContextId(String contextId) {
66          this.contextId = contextId;
67      }
68  
69      public String getTermSpecificationId() {
70          if (termSpecification != null) {
71              return termSpecification.getId();
72          }
73  
74          return null;
75      }
76  
77      public Boolean getPrereq() {
78          return prereq;
79      }
80  
81      public void setPrereq(Boolean prereq) {
82          this.prereq = prereq;
83      }
84  
85      public TermSpecificationBo getTermSpecification() {
86          return termSpecification;
87      }
88  
89      public void setTermSpecification(TermSpecificationBo termSpecification) {
90          this.termSpecification = termSpecification;
91      }
92  }