1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.core.document.entity;
17
18 import java.util.Date;
19 import java.util.List;
20
21 import javax.persistence.AttributeOverride;
22 import javax.persistence.AttributeOverrides;
23 import javax.persistence.CascadeType;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.FetchType;
27 import javax.persistence.JoinColumn;
28 import javax.persistence.JoinTable;
29 import javax.persistence.Lob;
30 import javax.persistence.ManyToMany;
31 import javax.persistence.ManyToOne;
32 import javax.persistence.OneToMany;
33 import javax.persistence.Table;
34 import javax.persistence.Temporal;
35 import javax.persistence.TemporalType;
36
37 import org.kuali.student.core.entity.AttributeOwner;
38 import org.kuali.student.core.entity.MetaEntity;
39
40
41
42
43
44
45
46 @Entity
47 @Table(name = "KSDO_DOCUMENT")
48 @AttributeOverrides({
49 @AttributeOverride(name="id", column=@Column(name="DOC_ID"))})
50 public class Document extends MetaEntity implements AttributeOwner<DocumentAttribute> {
51 private static final long serialVersionUID = 1L;
52
53 @Column(name = "NAME")
54 private String name;
55
56 @Column(name = "FILE_NAME")
57 private String fileName;
58
59 @ManyToOne(cascade = CascadeType.ALL)
60 @JoinColumn(name = "RT_DESCR_ID")
61 private DocumentRichText descr;
62
63 @Lob
64 @Column(name = "DOCUMENT", length=10000000)
65 private String document;
66
67 @Temporal(TemporalType.TIMESTAMP)
68 @Column(name = "EFF_DT")
69 private Date effectiveDate;
70
71 @Temporal(TemporalType.TIMESTAMP)
72 @Column(name = "EXPIR_DT")
73 private Date expirationDate;
74
75 @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
76 private List<DocumentAttribute> attributes;
77
78 @ManyToOne(optional=true)
79 @JoinColumn(name = "TYPE")
80 private DocumentType type;
81
82
83 @Column(name = "STATE")
84 private String state;
85
86
87 @ManyToMany(fetch=FetchType.EAGER)
88 @JoinTable(name="KSDO_DOCUMENT_JN_DOC_CATEGORY",
89 joinColumns=
90 @JoinColumn(name="DOC_ID", referencedColumnName="DOC_ID"),
91 inverseJoinColumns=
92 @JoinColumn(name="CATEGORY_ID", referencedColumnName="CATEGORY_ID")
93 )
94 private List<DocumentCategory> categoryList;
95
96 public String getName(){
97 return name;
98 }
99
100 public void setName(String name){
101 this.name=name;
102 }
103
104 public String getFileName(){
105 return fileName;
106 }
107
108 public void setFileName(String fileName){
109 this.fileName=fileName;
110 }
111
112
113
114
115 public DocumentRichText getDescr() {
116 return descr;
117 }
118
119
120
121
122 public void setDescr(DocumentRichText descr) {
123 this.descr = descr;
124 }
125
126
127 public String getDocument(){
128 return document;
129 }
130
131 public void setDocument(String document){
132 this.document=document;
133 }
134
135
136
137
138 public Date getEffectiveDate() {
139 return effectiveDate;
140 }
141
142
143
144
145 public void setEffectiveDate(Date effectiveDate) {
146 this.effectiveDate = effectiveDate;
147 }
148
149
150
151
152 public Date getExpirationDate() {
153 return expirationDate;
154 }
155
156
157
158
159 public void setExpirationDate(Date expirationDate) {
160 this.expirationDate = expirationDate;
161 }
162
163
164 @Override
165 public List<DocumentAttribute> getAttributes() {
166 return attributes;
167 }
168
169 @Override
170 public void setAttributes(List<DocumentAttribute> attributes) {
171 this.attributes = attributes;
172 }
173
174
175
176
177 public DocumentType getType() {
178 return type;
179 }
180
181
182
183
184 public void setType(DocumentType type) {
185 this.type = type;
186 }
187
188
189
190
191 public String getState() {
192 return state;
193 }
194
195
196
197
198 public void setState(String state) {
199 this.state = state;
200 }
201
202
203 public List<DocumentCategory> getCategoryList(){
204 return categoryList;
205 }
206
207 public void setCategoryList(List<DocumentCategory> categoryList){
208 this.categoryList = categoryList;
209 }
210
211 }