|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Statement | Line # 46 | 19 | 0% | 20 | 6 | 85% |
0.85
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(49) | |||
Result | |||
0.8
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateProgramRequirement org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateProgramRequirement | 1 PASS | |
0.8
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteProgramRequirement org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testDeleteProgramRequirement | 1 PASS | |
0.8
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateProgramRequirement org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateProgramRequirement | 1 PASS | |
0.8
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreditsProgramRequirement org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreditsProgramRequirement | 1 PASS | |
0.8
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testUpdateStatementTreeViewFromEmpty org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testUpdateStatementTreeViewFromEmpty | 1 PASS | |
0.8
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testCreateStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testCreateStatement | 1 PASS | |
0.8
|
org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCourseVersioning org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCourseVersioning | 1 PASS | |
0.8
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testUpdateStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testUpdateStatement | 1 PASS | |
0.8
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateMajorDisciplineRemoveRule org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testUpdateMajorDisciplineRemoveRule | 1 PASS | |
0.8
|
org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCreateCourseStatement org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCreateCourseStatement | 1 PASS | |
0.8
|
org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testUpdateCourseStatement org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testUpdateCourseStatement | 1 PASS | |
0.8
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateMajorDisciplineDeleteRule org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testCreateMajorDisciplineDeleteRule | 1 PASS | |
0.8
|
org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testDeleteCourseStatement org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testDeleteCourseStatement | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatementsUsingReqComponent org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatementsUsingReqComponent | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatement | 1 PASS | |
0.4
|
org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetProgramRequirement org.kuali.student.lum.program.service.impl.TestProgramServiceImpl.testGetProgramRequirement | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testUpdateStatement_VersionMismatchException org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testUpdateStatement_VersionMismatchException | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatementsByType org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatementsByType | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatements_DetailInfo org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatements_DetailInfo | 1 PASS | |
0.4
|
org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCreateCourseStatement_duplicateTree org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testCreateCourseStatement_duplicateTree | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testDeleteStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testDeleteStatement | 1 PASS | |
0.4
|
org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCourseStatement org.kuali.student.lum.course.service.impl.TestCourseServiceImpl.testGetCourseStatement | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testStatementStatementRelation org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testStatementStatementRelation | 1 PASS | |
0.4
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatementsUsingStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetStatementsUsingStatement | 1 PASS | |
0.35
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement6 org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement6 | 1 PASS | |
0.35
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement4 org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement4 | 1 PASS | |
0.3
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent4 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent4 | 1 PASS | |
0.3
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement2 org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement2 | 1 PASS | |
0.3
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent1 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent1 | 1 PASS | |
0.3
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement5 org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement5 | 1 PASS | |
0.3
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent3 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent3 | 1 PASS | |
0.25
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_EnglishGerman org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_EnglishGerman | 1 PASS | |
0.25
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement3 org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement3 | 1 PASS | |
0.25
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_English_EmptyCluId org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_English_EmptyCluId | 1 PASS | |
0.25
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_German org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_German | 1 PASS | |
0.25
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_English org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_English | 1 PASS | |
0.25
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_English_NullCluId org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatement1_English_NullCluId | 1 PASS | |
0.2
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsStatement3 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsStatement3 | 1 PASS | |
0.2
|
org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatementId1 org.kuali.student.core.statement.naturallanguage.translators.StatementTranslatorTest.testTranslateStatementId1 | 1 PASS | |
0.2
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsStatement1 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsStatement1 | 1 PASS | |
0.2
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent0 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsReqComponent0 | 1 PASS | |
0.2
|
org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsStatement2 org.kuali.student.core.statement.naturallanguage.translators.StatementParserTest.testBooleanExpressionAsStatement2 | 1 PASS | |
0.15
|
org.kuali.student.core.statement.naturallanguage.translators.NaturalLanguageTranslatorTest.testTranslateStatement_EnglishGerman org.kuali.student.core.statement.naturallanguage.translators.NaturalLanguageTranslatorTest.testTranslateStatement_EnglishGerman | 1 PASS | |
0.15
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetNaturalLanguageForStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetNaturalLanguageForStatement | 1 PASS | |
0.15
|
org.kuali.student.lum.statement.service.impl.TestStatementServiceImplForProgram.testTranslateStatementTree org.kuali.student.lum.statement.service.impl.TestStatementServiceImplForProgram.testTranslateStatementTree | 1 PASS | |
0.15
|
org.kuali.student.core.statement.naturallanguage.translators.NaturalLanguageTranslatorTest.testTranslateStatement_German org.kuali.student.core.statement.naturallanguage.translators.NaturalLanguageTranslatorTest.testTranslateStatement_German | 1 PASS | |
0.15
|
org.kuali.student.core.statement.naturallanguage.translators.NaturalLanguageTranslatorTest.testTranslateStatement_English org.kuali.student.core.statement.naturallanguage.translators.NaturalLanguageTranslatorTest.testTranslateStatement_English | 1 PASS | |
0.15
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetNaturalLanguageForRefStatementRelation org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetNaturalLanguageForRefStatementRelation | 1 PASS | |
0.05
|
org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetRefStatementRelationsByStatement org.kuali.student.core.statement.service.impl.TestStatementServiceImpl.testGetRefStatementRelationsByStatement | 1 PASS | |
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 | public List<Statement> getChildren() { |
82 | 757 | return children; |
83 | } | |
84 | ||
85 | 106 | public void setChildren(List<Statement> children) { |
86 | 106 | this.children = children; |
87 | } | |
88 | ||
89 | 573 | public List<ReqComponent> getRequiredComponents() { |
90 | 573 | return requiredComponents; |
91 | } | |
92 | ||
93 | 119 | public void setRequiredComponents(List<ReqComponent> requiredComponents) { |
94 | 119 | this.requiredComponents = requiredComponents; |
95 | } | |
96 | ||
97 | 186 | public StatementType getStatementType() { |
98 | 186 | return statementType; |
99 | } | |
100 | ||
101 | 88 | public void setStatementType(StatementType statementType) { |
102 | 88 | this.statementType = statementType; |
103 | } | |
104 | ||
105 | 535 | public StatementOperatorTypeKey getOperator() { |
106 | 535 | return operator; |
107 | } | |
108 | ||
109 | 141 | public void setOperator(StatementOperatorTypeKey operator) { |
110 | 141 | this.operator = operator; |
111 | } | |
112 | ||
113 | 366 | public String getName() { |
114 | 366 | return name; |
115 | } | |
116 | ||
117 | 80 | public void setName(String name) { |
118 | 80 | this.name = name; |
119 | } | |
120 | ||
121 | 186 | public StatementRichText getDescr() { |
122 | 186 | return descr; |
123 | } | |
124 | ||
125 | 80 | public void setDescr(StatementRichText descr) { |
126 | 80 | this.descr = descr; |
127 | } | |
128 | ||
129 | 426 | @Override |
130 | public List<StatementAttribute> getAttributes() { | |
131 | 426 | return attributes; |
132 | } | |
133 | ||
134 | 119 | @Override |
135 | public void setAttributes(List<StatementAttribute> attributes) { | |
136 | 119 | this.attributes=attributes; |
137 | } | |
138 | ||
139 | 186 | public String getState() { |
140 | 186 | return state; |
141 | } | |
142 | ||
143 | 80 | public void setState(String state) { |
144 | 80 | this.state = state; |
145 | } | |
146 | ||
147 | 1 | public List<RefStatementRelation> getRefStatementRelations() { |
148 | 1 | return refStatementRelations; |
149 | } | |
150 | ||
151 | 0 | public void setRefStatementRelations( |
152 | List<RefStatementRelation> refStatementRelations) { | |
153 | 0 | this.refStatementRelations = refStatementRelations; |
154 | } | |
155 | ||
156 | 0 | @Override |
157 | public String toString() { | |
158 | 0 | return "Statement[id=" + getId() + ", statementType=" |
159 | 0 | + (statementType == null ? "null" : statementType.getId()) |
160 | + ", operator=" + operator + "]"; | |
161 | } | |
162 | } |
|