View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.r2.lum.lu.entity;
17  
18  import java.util.Date;
19  import java.util.List;
20  
21  import javax.persistence.CascadeType;
22  import javax.persistence.Column;
23  import javax.persistence.Entity;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.JoinTable;
26  import javax.persistence.ManyToOne;
27  import javax.persistence.NamedQueries;
28  import javax.persistence.NamedQuery;
29  import javax.persistence.OneToMany;
30  import javax.persistence.Table;
31  import javax.persistence.Temporal;
32  import javax.persistence.TemporalType;
33  
34  import org.kuali.student.r2.common.entity.MetaEntity;
35  
36  @Entity
37  @Table(name = "KSLU_CLU_RSLT")
38  @NamedQueries( {
39          @NamedQuery(name = "CluResult.getCluResultByCluId", query = "SELECT cr FROM CluResult cr WHERE cr.clu.id = :cluId"),
40          @NamedQuery(name = "CluResult.getCluResultsByCluIds", query = "SELECT cr FROM CluResult cr WHERE cr.clu.id in (:cluIds)"),
41          @NamedQuery(name = "CluResult.getCluIdByResultUsageType", query = "SELECT cr.clu.id FROM CluResult cr INNER JOIN cr.resultOptions res WHERE res.resultUsageType = :resultUsageType"),
42          @NamedQuery(name = "CluResult.getCluIdByResultComponentId", query = "SELECT cr.clu.id FROM CluResult cr INNER JOIN cr.resultOptions res WHERE res.resultComponentId = :resultComponentId")
43  })
44  public class CluResult extends MetaEntity  {
45  
46      @ManyToOne(cascade=CascadeType.ALL)
47      @JoinColumn(name = "RT_DESCR_ID")
48      private LuRichText desc;
49  
50      @Temporal(TemporalType.TIMESTAMP)
51      @Column(name = "EFF_DT")
52      private Date effectiveDate;
53  
54      @Temporal(TemporalType.TIMESTAMP)
55      @Column(name = "EXPIR_DT")
56      private Date expirationDate;
57  
58      @ManyToOne
59      @JoinColumn(name = "CLU_ID")
60      private Clu clu;
61  
62      @OneToMany(cascade=CascadeType.ALL)
63      @JoinTable(name = "KSLU_CLURES_JN_RESOPT", joinColumns = @JoinColumn(name = "CLU_RES_ID"), inverseJoinColumns = @JoinColumn(name = "RES_OPT_ID"))
64      private List<ResultOption> resultOptions;
65  
66      @ManyToOne
67      @JoinColumn(name="TYPE_KEY_ID")
68      private CluResultType cluResultType;
69  
70      @Column(name = "ST")
71      private String state;
72  
73      public LuRichText getDesc() {
74          return desc;
75      }
76  
77      public void setDesc(LuRichText desc) {
78          this.desc = desc;
79      }
80  
81      public Date getEffectiveDate() {
82          return effectiveDate;
83      }
84  
85      public void setEffectiveDate(Date effectiveDate) {
86          this.effectiveDate = effectiveDate;
87      }
88  
89      public Date getExpirationDate() {
90          return expirationDate;
91      }
92  
93      public void setExpirationDate(Date expirationDate) {
94          this.expirationDate = expirationDate;
95      }
96  
97      public Clu getClu() {
98          return clu;
99      }
100 
101     public void setClu(Clu clu) {
102         this.clu = clu;
103     }
104 
105     public List<ResultOption> getResultOptions() {
106         return resultOptions;
107     }
108 
109     public void setResultOptions(List<ResultOption> resultOptions) {
110         this.resultOptions = resultOptions;
111     }
112 
113     public CluResultType getCluResultType() {
114         return cluResultType;
115     }
116 
117     public void setCluResultType(CluResultType type) {
118         this.cluResultType = type;
119     }
120 
121     public String getState() {
122         return state;
123     }
124 
125     public void setState(String state) {
126         this.state = state;
127     }
128 
129 }