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