1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.core.comment.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.NamedQueries; |
27 |
|
import javax.persistence.NamedQuery; |
28 |
|
import javax.persistence.OneToMany; |
29 |
|
import javax.persistence.Table; |
30 |
|
import javax.persistence.Temporal; |
31 |
|
import javax.persistence.TemporalType; |
32 |
|
|
33 |
|
import org.kuali.student.common.entity.AttributeOwner; |
34 |
|
import org.kuali.student.common.entity.MetaEntity; |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
@author |
40 |
|
|
41 |
|
|
42 |
|
@Entity |
43 |
|
@Table(name = "KSCO_COMMENT") |
44 |
|
@NamedQueries( { |
45 |
|
@NamedQuery(name = "Comment.getComments", query = "SELECT comment FROM Comment comment JOIN comment.reference r1 WHERE r1.referenceId =:refId AND r1.referenceType.id =:refTypeId ORDER BY comment.meta.updateTime DESC"), |
46 |
|
@NamedQuery(name = "Comment.getComment", query = "SELECT comment FROM Comment comment JOIN comment.reference r1 WHERE r1.referenceId =:refId AND r1.referenceType.id =:refTypeId"), |
47 |
|
@NamedQuery(name = "Comment.getCommentsByType", query = "SELECT comment FROM Comment comment JOIN comment.reference r1 WHERE r1.referenceId =:refId AND r1.referenceType.id =:refTypeId AND comment.type.id =:commentTypeId"), |
48 |
|
@NamedQuery(name = "Comment.getCommentsByRefId", query="SELECT comment FROM Comment comment JOIN comment.reference r1 WHERE r1.referenceId =:refId")}) |
|
|
| 92.9% |
Uncovered Elements: 2 (28) |
Complexity: 14 |
Complexity Density: 1 |
|
49 |
|
public class Comment extends MetaEntity implements AttributeOwner<CommentAttribute> { |
50 |
|
private static final long serialVersionUID = 1L; |
51 |
|
|
52 |
|
@ManyToOne(cascade = CascadeType.ALL) |
53 |
|
@JoinColumn(name = "RT_DESCR_ID") |
54 |
|
private CommentRichText commentText; |
55 |
|
|
56 |
|
@ManyToOne |
57 |
|
@JoinColumn(name = "REFERENCE") |
58 |
|
private Reference reference; |
59 |
|
|
60 |
|
@Temporal(TemporalType.TIMESTAMP) |
61 |
|
@Column(name = "EFF_DT") |
62 |
|
private Date effectiveDate; |
63 |
|
|
64 |
|
@Temporal(TemporalType.TIMESTAMP) |
65 |
|
@Column(name = "EXPIR_DT") |
66 |
|
private Date expirationDate; |
67 |
|
|
68 |
|
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
69 |
|
private List<CommentAttribute> attributes; |
70 |
|
|
71 |
|
@ManyToOne |
72 |
|
@JoinColumn(name = "TYPE") |
73 |
|
private CommentType type; |
74 |
|
|
75 |
|
@Column(name = "STATE") |
76 |
|
private String state; |
77 |
|
|
78 |
|
|
79 |
|
@return |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
11
|
public CommentRichText getCommentText() {... |
82 |
11
|
return commentText; |
83 |
|
} |
84 |
|
|
85 |
|
|
86 |
|
@param |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
5
|
public void setCommentText(CommentRichText commentText) {... |
89 |
5
|
this.commentText = commentText; |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
@param |
94 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
5
|
public void setReference(Reference reference) {... |
96 |
5
|
this.reference = reference; |
97 |
|
} |
98 |
|
|
99 |
|
|
100 |
|
@return |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0
|
public Reference getReference() {... |
103 |
0
|
return reference; |
104 |
|
} |
105 |
|
|
106 |
|
|
107 |
|
@return |
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
11
|
public Date getEffectiveDate() {... |
110 |
11
|
return effectiveDate; |
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
|
@param |
115 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
5
|
public void setEffectiveDate(Date effectiveDate) {... |
117 |
5
|
this.effectiveDate = effectiveDate; |
118 |
|
} |
119 |
|
|
120 |
|
|
121 |
|
@return |
122 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
11
|
public Date getExpirationDate() {... |
124 |
11
|
return expirationDate; |
125 |
|
} |
126 |
|
|
127 |
|
|
128 |
|
@param |
129 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
5
|
public void setExpirationDate(Date expirationDate) {... |
131 |
5
|
this.expirationDate = expirationDate; |
132 |
|
} |
133 |
|
|
134 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
38
|
@Override... |
136 |
|
public List<CommentAttribute> getAttributes() { |
137 |
38
|
return attributes; |
138 |
|
} |
139 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
13
|
@Override... |
141 |
|
public void setAttributes(List<CommentAttribute> attributes) { |
142 |
13
|
this.attributes = attributes; |
143 |
|
} |
144 |
|
|
145 |
|
|
146 |
|
@return |
147 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
11
|
public CommentType getType() {... |
149 |
11
|
return type; |
150 |
|
} |
151 |
|
|
152 |
|
|
153 |
|
@param |
154 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
155 |
5
|
public void setType(CommentType type) {... |
156 |
5
|
this.type = type; |
157 |
|
} |
158 |
|
|
159 |
|
|
160 |
|
@return |
161 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
162 |
11
|
public String getState() {... |
163 |
11
|
return state; |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
|
@param |
168 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
169 |
5
|
public void setState(String state) {... |
170 |
5
|
this.state = state; |
171 |
|
} |
172 |
|
|
173 |
|
} |