Clover Coverage Report - Kuali Student 1.1 (Aggregated)
Coverage timestamp: Sun Mar 6 2011 20:32:39 EST
../../../../../../img/srcFileCovDistChart9.png 32% of files have more coverage
19   162   20   1
2   115   1.05   19
19     1.05  
1    
 
  Statement       Line # 46 19 0% 20 6 85% 0.85
 
  (49)
 
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.core.statement.entity;
17   
18    import java.util.List;
19   
20    import javax.persistence.CascadeType;
21    import javax.persistence.Column;
22    import javax.persistence.Entity;
23    import javax.persistence.EnumType;
24    import javax.persistence.Enumerated;
25    import javax.persistence.JoinColumn;
26    import javax.persistence.JoinTable;
27    import javax.persistence.ManyToMany;
28    import javax.persistence.ManyToOne;
29    import javax.persistence.NamedQueries;
30    import javax.persistence.NamedQuery;
31    import javax.persistence.OneToMany;
32    import javax.persistence.Table;
33   
34    import org.kuali.student.core.entity.AttributeOwner;
35    import org.kuali.student.core.entity.MetaEntity;
36    import org.kuali.student.core.statement.dto.StatementOperatorTypeKey;
37   
38    @Entity
39    @Table(name = "KSST_STMT")
40    @NamedQueries( {
41    @NamedQuery(name = "Statement.getStatementsForStatementType", query = "SELECT ls FROM Statement ls WHERE ls.statementType.id = :statementTypeKey"),
42    @NamedQuery(name = "Statement.getStatements", query = "SELECT ls FROM Statement ls WHERE ls.id IN (:statementIdList)"),
43    @NamedQuery(name = "Statement.getStatementsForReqComponent", query = "SELECT ls FROM Statement ls JOIN ls.requiredComponents req WHERE req.id = :reqComponentId"),
44    @NamedQuery(name = "Statement.getParentStatement", query = "SELECT DISTINCT stmt FROM Statement stmt JOIN stmt.children children WHERE children.id = :childId")
45    })
 
46    public class Statement extends MetaEntity implements AttributeOwner<StatementAttribute>{
47   
48    @Column(name="NAME")
49    private String name;
50   
51    @ManyToOne(cascade=CascadeType.ALL)
52    @JoinColumn(name = "RT_DESCR_ID")
53    private StatementRichText descr;
54   
55    @Column(name="ST")
56    private String state;
57   
58    @Column(name="OPERATOR")
59    @Enumerated(EnumType.STRING)
60    private StatementOperatorTypeKey operator;
61   
62    @OneToMany(cascade = {CascadeType.ALL})
63    @JoinTable(name = "KSST_STMT_JN_STMT", joinColumns = @JoinColumn(name = "STMT_ID"), inverseJoinColumns = @JoinColumn(name = "CHLD_STMT_ID"))
64    private List<Statement> children;
65   
66    @ManyToMany
67    @JoinTable(name = "KSST_STMT_JN_REQ_COM", joinColumns = @JoinColumn(name = "STMT_ID"), inverseJoinColumns = @JoinColumn(name = "REQ_COM_ID"))
68    private List<ReqComponent> requiredComponents;
69   
70    @ManyToOne
71    @JoinColumn(name = "STMT_TYPE_ID")
72    private StatementType statementType;
73   
74    @OneToMany(cascade = CascadeType.ALL)
75    @JoinColumn(name = "OWNER")
76    private List<StatementAttribute> attributes;
77   
78    @OneToMany(mappedBy = "statement")
79    private List<RefStatementRelation> refStatementRelations;
80   
 
81  757 toggle public List<Statement> getChildren() {
82  757 return children;
83    }
84   
 
85  106 toggle public void setChildren(List<Statement> children) {
86  106 this.children = children;
87    }
88   
 
89  573 toggle public List<ReqComponent> getRequiredComponents() {
90  573 return requiredComponents;
91    }
92   
 
93  119 toggle public void setRequiredComponents(List<ReqComponent> requiredComponents) {
94  119 this.requiredComponents = requiredComponents;
95    }
96   
 
97  186 toggle public StatementType getStatementType() {
98  186 return statementType;
99    }
100   
 
101  88 toggle public void setStatementType(StatementType statementType) {
102  88 this.statementType = statementType;
103    }
104   
 
105  535 toggle public StatementOperatorTypeKey getOperator() {
106  535 return operator;
107    }
108   
 
109  141 toggle public void setOperator(StatementOperatorTypeKey operator) {
110  141 this.operator = operator;
111    }
112   
 
113  366 toggle public String getName() {
114  366 return name;
115    }
116   
 
117  80 toggle public void setName(String name) {
118  80 this.name = name;
119    }
120   
 
121  186 toggle public StatementRichText getDescr() {
122  186 return descr;
123    }
124   
 
125  80 toggle public void setDescr(StatementRichText descr) {
126  80 this.descr = descr;
127    }
128   
 
129  426 toggle @Override
130    public List<StatementAttribute> getAttributes() {
131  426 return attributes;
132    }
133   
 
134  119 toggle @Override
135    public void setAttributes(List<StatementAttribute> attributes) {
136  119 this.attributes=attributes;
137    }
138   
 
139  186 toggle public String getState() {
140  186 return state;
141    }
142   
 
143  80 toggle public void setState(String state) {
144  80 this.state = state;
145    }
146   
 
147  1 toggle public List<RefStatementRelation> getRefStatementRelations() {
148  1 return refStatementRelations;
149    }
150   
 
151  0 toggle public void setRefStatementRelations(
152    List<RefStatementRelation> refStatementRelations) {
153  0 this.refStatementRelations = refStatementRelations;
154    }
155   
 
156  0 toggle @Override
157    public String toString() {
158  0 return "Statement[id=" + getId() + ", statementType="
159  0 + (statementType == null ? "null" : statementType.getId())
160    + ", operator=" + operator + "]";
161    }
162    }