package uk.ac.ebi.spot.goci.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import java.util.Date;

/**
 * Created by emma on 08/06/2016.
 * @author emma
 *
 *  Model of WEEKLY_PROGRESS_VIEW table
 */
@Entity
public class WeeklyProgressView {

    @Id
    private Long id;

    private Date weekStartDate;

    @Enumerated(EnumType.STRING)
    private EventType eventType;

    private Integer numberOfStudies;

    // JPA no-args constructor
    public WeeklyProgressView() {
    }

    public WeeklyProgressView(Long id, Integer numberOfStudies, EventType eventType, Date weekStartDate) {
        this.id = id;
        this.numberOfStudies = numberOfStudies;
        this.eventType = eventType;
        this.weekStartDate = weekStartDate;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getWeekStartDate() {
        return weekStartDate;
    }

    public void setWeekStartDate(Date weekStartDate) {
        this.weekStartDate = weekStartDate;
    }

    public EventType getEventType() {
        return eventType;
    }

    public void setEventType(EventType eventType) {
        this.eventType = eventType;
    }

    public Integer getNumberOfStudies() {
        return numberOfStudies;
    }

    public void setNumberOfStudies(Integer numberOfStudies) {
        this.numberOfStudies = numberOfStudies;
    }
}

@@ -225,16 +225,19 @@
 6/2016.%0A
+ *%0A
  * @auth
@@ -246,19 +246,38 @@
  emma%0A *
-%0A *
+         %3Cp%3E%0A *       
   Model 
@@ -412,24 +412,51 @@
 StartDate;%0A%0A
+    private Long studyId;%0A%0A
     @Enumera
@@ -662,145 +662,307 @@
  id,
- Integer numberOfStudies, EventType eventType, Date weekStartDate) %7B%0A        this.id = id;%0A        this.numberOfStudies = numberOfStudies
+%0A                              Date weekStartDate,%0A                              Long studyId,%0A                              EventType eventType,%0A                              Integer numberOfStudies) %7B%0A        this.id = id;%0A        this.weekStartDate = weekStartDate;%0A        this.studyId = studyId
 ;%0A  
@@ -1012,37 +1012,41 @@
 his.
-weekStartDate = weekStartDate
+numberOfStudies = numberOfStudies
 ;%0A  
@@ -1706,11 +1706,155 @@
 s;%0A    %7D
+%0A%0A    public Long getStudyId() %7B%0A        return studyId;%0A    %7D%0A%0A    public void setStudyId(Long studyId) %7B%0A        this.studyId = studyId;%0A    %7D
 %0A%7D%0A

Add study ID