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.r1.lum.lrc.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.ManyToOne;
26  import javax.persistence.OneToMany;
27  import javax.persistence.Table;
28  import javax.persistence.Temporal;
29  import javax.persistence.TemporalType;
30  
31  import org.kuali.student.r1.common.entity.AttributeOwner;
32  import org.kuali.student.r1.common.entity.MetaEntity;
33  import org.kuali.student.r1.lum.lrc.entity.LrcRichText;
34  import org.kuali.student.r1.lum.lrc.entity.ScaleAttribute;
35  
36  @Entity
37  @Table(name = "KSLR_SCALE")
38  public class Scale extends MetaEntity implements AttributeOwner<ScaleAttribute>{
39  
40      @Column(name = "NAME")
41      private String name;
42  
43      @ManyToOne(cascade = CascadeType.ALL)
44      @JoinColumn(name = "RT_DESCR_ID")
45      private LrcRichText descr;
46  
47      @Temporal(TemporalType.TIMESTAMP)
48      @Column(name = "EFF_DT")
49      private Date effectiveDate;
50  
51      @Temporal(TemporalType.TIMESTAMP)
52      @Column(name = "EXPIR_DT")
53      private Date expirationDate;
54  
55      @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
56      private List<ScaleAttribute> attributes;
57  
58      /**
59       * @return the name
60       */
61      public String getName() {
62          return name;
63      }
64  
65      /**
66       * @param name the name to set
67       */
68      public void setName(String name) {
69          this.name = name;
70      }
71  
72      /**
73       * @return the descr
74       */
75      public LrcRichText getDesc() {
76          return descr;
77      }
78  
79      /**
80       * @param descr the descr to set
81       */
82      public void setDesc(LrcRichText descr) {
83          this.descr = descr;
84      }
85  
86      /**
87       * @return the effectiveDate
88       */
89      public Date getEffectiveDate() {
90          return effectiveDate;
91      }
92  
93      /**
94       * @param effectiveDate the effectiveDate to set
95       */
96      public void setEffectiveDate(Date effectiveDate) {
97          this.effectiveDate = effectiveDate;
98      }
99  
100     /**
101      * @return the expirationDate
102      */
103     public Date getExpirationDate() {
104         return expirationDate;
105     }
106 
107     /**
108      * @param expirationDate the expirationDate to set
109      */
110     public void setExpirationDate(Date expirationDate) {
111         this.expirationDate = expirationDate;
112     }
113 
114     @Override
115     public List<ScaleAttribute> getAttributes() {
116         return attributes;
117     }
118 
119     @Override
120     public void setAttributes(List<ScaleAttribute> attributes) {
121         this.attributes = attributes;
122     }
123 
124 }