File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
goci-core/goci-model/src/main/java/uk/ac/ebi/spot/goci/model Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
4
4
import com .fasterxml .jackson .annotation .JsonIgnore ;
5
+ import com .fasterxml .jackson .annotation .JsonInclude ;
5
6
import com .fasterxml .jackson .annotation .JsonManagedReference ;
6
7
import com .fasterxml .jackson .annotation .JsonProperty ;
7
8
import org .hibernate .annotations .Where ;
@@ -19,6 +20,20 @@ public class Study implements Trackable {
19
20
@ JsonIgnore
20
21
private Long id ;
21
22
23
+ @ Transient
24
+ @ JsonInclude (JsonInclude .Include .NON_NULL )
25
+ private String cohort ;
26
+
27
+ @ OneToOne (mappedBy = "study" )
28
+ @ JsonIgnore
29
+ private StudyExtension studyExtension ;
30
+
31
+ @ PostLoad
32
+ private void onLoad () {
33
+ if (this .studyExtension != null )
34
+ this .cohort = studyExtension .getCohort ();
35
+ }
36
+
22
37
private String initialSampleSize ;
23
38
24
39
@ JsonProperty ("replicationSampleSize" )
@@ -189,6 +204,10 @@ public void setId(Long id) {
189
204
this .id = id ;
190
205
}
191
206
207
+ public String getCohort () {
208
+ return cohort ;
209
+ }
210
+
192
211
public String getInitialSampleSize () {
193
212
return initialSampleSize ;
194
213
}
Original file line number Diff line number Diff line change
1
+ package uk .ac .ebi .spot .goci .model ;
2
+
3
+ import lombok .Data ;
4
+
5
+ import javax .persistence .*;
6
+ import java .util .Collection ;
7
+
8
+ @ Entity
9
+ @ Data
10
+ public class StudyExtension {
11
+
12
+ @ Id
13
+ @ GeneratedValue
14
+ private Long id ;
15
+
16
+ @ OneToOne
17
+ @ JoinColumn (name = "study_id" , unique = true )
18
+ private Study study ;
19
+
20
+ private String statisticalModel ;
21
+
22
+ private String cohort ;
23
+
24
+ private String cohortSpecificReference ;
25
+
26
+ private String summaryStatisticsFile ;
27
+
28
+ private String summaryStatisticsAssembly ;
29
+
30
+ private String studyDescription ;
31
+ }
You can’t perform that action at this time.
0 commit comments