Skip to content

Commit c3457f1

Browse files
committed
Add evaluation entity and embeddedId #1467
1 parent b0aba9f commit c3457f1

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package ch.puzzle.okr.models.evaluation;
2+
3+
import jakarta.persistence.EmbeddedId;
4+
import jakarta.persistence.Entity;
5+
import org.hibernate.annotations.Immutable;
6+
7+
@Entity
8+
@Immutable
9+
public class EvaluationView {
10+
@EmbeddedId
11+
private EvaluationViewId evaluationViewId;
12+
13+
private int objectiveAmount;
14+
private int completedObjectivesAmount;
15+
private int successfullyCompletedObjectivesAmount;
16+
17+
private int keyResultAmount;
18+
private int keyResultsOrdinalAmount;
19+
private int keyResultsMetricAmount;
20+
private int keyResultsInTargetOrStretchAmount;
21+
22+
private int keyResultsInFailAmount;
23+
private int keyResultsInCommitAmount;
24+
private int keyResultsInTargetAmount;
25+
private int keyResultsInStretchAmount;
26+
27+
public EvaluationViewId getEvaluationViewId() {
28+
return evaluationViewId;
29+
}
30+
31+
public int getObjectiveAmount() {
32+
return objectiveAmount;
33+
}
34+
35+
public int getCompletedObjectivesAmount() {
36+
return completedObjectivesAmount;
37+
}
38+
39+
public int getSuccessfullyCompletedObjectivesAmount() {
40+
return successfullyCompletedObjectivesAmount;
41+
}
42+
43+
public int getKeyResultAmount() {
44+
return keyResultAmount;
45+
}
46+
47+
public int getKeyResultsOrdinalAmount() {
48+
return keyResultsOrdinalAmount;
49+
}
50+
51+
public int getKeyResultsMetricAmount() {
52+
return keyResultsMetricAmount;
53+
}
54+
55+
public int getKeyResultsInTargetOrStretchAmount() {
56+
return keyResultsInTargetOrStretchAmount;
57+
}
58+
59+
public int getKeyResultsInFailAmount() {
60+
return keyResultsInFailAmount;
61+
}
62+
63+
public int getKeyResultsInCommitAmount() {
64+
return keyResultsInCommitAmount;
65+
}
66+
67+
public int getKeyResultsInTargetAmount() {
68+
return keyResultsInTargetAmount;
69+
}
70+
71+
public int getKeyResultsInStretchAmount() {
72+
return keyResultsInStretchAmount;
73+
}
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package ch.puzzle.okr.models.evaluation;
2+
3+
import ch.puzzle.okr.models.overview.OverviewId;
4+
import jakarta.persistence.Embeddable;
5+
import jakarta.persistence.EmbeddedId;
6+
7+
import java.io.Serializable;
8+
9+
10+
@Embeddable
11+
public class EvaluationViewId implements Serializable {
12+
private Long teamId;
13+
private Long quarterId;
14+
15+
public EvaluationViewId(Long teamId, Long quarterId) {
16+
this.teamId = teamId;
17+
this.quarterId = quarterId;
18+
}
19+
20+
public EvaluationViewId() {
21+
}
22+
23+
private EvaluationViewId(Builder builder) {
24+
teamId = builder.teamId;
25+
quarterId = builder.quarterId;
26+
}
27+
28+
public Long getTeamId() {
29+
return teamId;
30+
}
31+
32+
public Long getQuarterId() {
33+
return quarterId;
34+
}
35+
36+
public static final class Builder {
37+
private Long teamId;
38+
private Long quarterId;
39+
40+
private Builder() {
41+
}
42+
43+
public static Builder builder() {
44+
return new Builder();
45+
}
46+
47+
public Builder withTeamId(Long val) {
48+
teamId = val;
49+
return this;
50+
}
51+
52+
public Builder withQuarterId(Long val) {
53+
quarterId = val;
54+
return this;
55+
}
56+
57+
public EvaluationViewId build() {
58+
return new EvaluationViewId(this);
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)