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.lum.lo.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.OneToOne;
28  import javax.persistence.Table;
29  import javax.persistence.Temporal;
30  import javax.persistence.TemporalType;
31  
32  import org.kuali.student.common.entity.AttributeOwner;
33  import org.kuali.student.common.entity.MetaEntity;
34  
35  /**
36   * @author Kuali Student Team
37   */
38  @Entity
39  @Table(name = "KSLO_LO_REPOSITORY")
40  public class LoRepository extends MetaEntity implements AttributeOwner<LoRepositoryAttribute> {
41  
42  	@Column(name = "NAME")
43  	private String name;
44  	
45  	@ManyToOne(cascade = CascadeType.ALL)
46  	@JoinColumn(name = "RT_DESCR_ID")
47  	private LoRichText descr;
48  	
49  	@OneToOne
50  	@JoinColumn(name = "LO_ROOT_ID")
51  	private Lo rootLo;
52  	
53  	@Temporal(TemporalType.TIMESTAMP)
54  	@Column(name = "EFF_DT")
55  	private Date effectiveDate;
56  
57  	@Temporal(TemporalType.TIMESTAMP)
58  	@Column(name = "EXPIR_DT")
59  	private Date expirationDate;
60  
61  	@OneToMany(cascade = CascadeType.ALL, mappedBy = "loRepository")
62  	private List<LoCategory> categories;
63  
64  	@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
65  	private List<LoRepositoryAttribute> attributes;
66  
67  	/**
68  	 * @param descr the descr to set
69  	 */
70  	public void setDescr(LoRichText descr) {
71  		this.descr = descr;
72  	}
73  
74  	/**
75  	 * @return the descr
76  	 */
77  	public LoRichText getDescr() {
78  		return descr;
79  	}
80  
81  	/**
82  	 * @param rootLo the rootLo to set
83  	 */
84  	public void setRootLo(Lo rootLo) {
85  		this.rootLo = rootLo;
86  	}
87  
88  	/**
89  	 * @return the rootLo
90  	 */
91  	public Lo getRootLo() {
92  		return rootLo;
93  	}
94  
95  	/**
96  	 * @param effectiveDate the effectiveDate to set
97  	 */
98  	public void setEffectiveDate(Date effectiveDate) {
99  		this.effectiveDate = effectiveDate;
100 	}
101 
102 	/**
103 	 * @return the effectiveDate
104 	 */
105 	public Date getEffectiveDate() {
106 		return effectiveDate;
107 	}
108 
109 	/**
110 	 * @param expirationDate the expirationDate to set
111 	 */
112 	public void setExpirationDate(Date expirationDate) {
113 		this.expirationDate = expirationDate;
114 	}
115 
116 	/**
117 	 * @return the expirationDate
118 	 */
119 	public Date getExpirationDate() {
120 		return expirationDate;
121 	}
122 
123 	/**
124 	 * @param categories the categories to set
125 	 */
126 	public void setCategories(List<LoCategory> categories) {
127 		this.categories = categories;
128 	}
129 
130 	/**
131 	 * @return the categories
132 	 */
133 	public List<LoCategory> getCategories() {
134 		return categories;
135 	}
136 
137 	/* (non-Javadoc)
138 	 * @see org.kuali.student.common.entity.AttributeOwner#getAttributes()
139 	 */
140 	@Override
141 	public List<LoRepositoryAttribute> getAttributes() {
142 		return attributes;
143 	}
144 
145 	/* (non-Javadoc)
146 	 * @see org.kuali.student.common.entity.AttributeOwner#setAttributes(java.util.List)
147 	 */
148 	@Override
149 	public void setAttributes(List<LoRepositoryAttribute> attributes) {
150 		this.attributes = attributes;
151 	}
152 
153 	/**
154 	 * @param name the name to set
155 	 */
156 	public void setName(String name) {
157 		this.name = name;
158 	}
159 
160 	/**
161 	 * @return the name
162 	 */
163 	public String getName() {
164 		return name;
165 	}
166 }