11
11
import java .time .Instant ;
12
12
import java .util .ArrayList ;
13
13
import java .util .Collection ;
14
- import java .util .Objects ;
15
14
import life .qbic .projectmanagement .domain .model .project .Project ;
16
15
import life .qbic .projectmanagement .domain .model .project .ProjectId ;
17
- import org .springframework . data . annotation .Immutable ;
16
+ import org .hibernate . annotations .Immutable ;
18
17
19
18
/**
20
19
* A limited view of the more complex {@link Project}.
23
22
*/
24
23
//Views are aggregates which cannot be changed
25
24
@ Immutable
25
+ @ org .springframework .data .annotation .Immutable
26
26
@ Entity
27
27
@ Table (name = "project_overview" )
28
28
public class ProjectOverview {
@@ -54,7 +54,6 @@ public class ProjectOverview {
54
54
@ Column (name = "amountPxpMeasurements" )
55
55
private String pxpMeasurementCount ;
56
56
57
- @ Column (name = "userName" )
58
57
@ ElementCollection (targetClass = String .class , fetch = FetchType .EAGER )
59
58
@ CollectionTable (name = "project_usernames" , joinColumns = @ JoinColumn (name = "projectId" ))
60
59
private Collection <String > collaboratorUserNames = new ArrayList <>();
@@ -63,26 +62,6 @@ protected ProjectOverview() {
63
62
64
63
}
65
64
66
- public ProjectOverview (ProjectId id , String projectTitle , String projectCode ,
67
- Instant lastModified , String principalInvestigatorName , String projectManagerName ,
68
- String projectResponsibleName ,
69
- String ngsMeasurementCount , String pxpMeasurementCount ,
70
- Collection <String > usernames ) {
71
- this .id = Objects .requireNonNull (id , "project Id cannot be null" );
72
- this .projectTitle = Objects .requireNonNull (projectTitle , "projectTitle cannot be null" );
73
- this .projectCode = Objects .requireNonNull (projectCode , "project code cannot be null" );
74
- this .lastModified = Objects .requireNonNull (lastModified , "lastModified date cannot be null" );
75
- this .principalInvestigatorName = Objects .requireNonNull (principalInvestigatorName ,
76
- "principal investigator name cannot be null" );
77
- this .projectManagerName = Objects .requireNonNull (projectManagerName ,
78
- "project manager name cannot be null" );
79
- this .projectResponsibleName = projectResponsibleName ;
80
- this .ngsMeasurementCount = ngsMeasurementCount ;
81
- this .pxpMeasurementCount = pxpMeasurementCount ;
82
- this .collaboratorUserNames = Objects .requireNonNull (usernames ,
83
- "The collaborator user names cannot be null" );
84
- }
85
-
86
65
public ProjectId projectId () {
87
66
return id ;
88
67
}
0 commit comments