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

import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * Created by emma on 28/04/2016.
 *
 * @author emma
 *         <p>
 *         Model of tracking event
 */
@Entity
public class Event {

    @Id
    @GeneratedValue
    private Long id;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date eventDate;

    @Enumerated(EnumType.STRING)
    private EventType eventType;

    @ManyToOne
    private SecureUser secureUser;

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

    public Event(Date eventDate, EventType eventType, SecureUser secureUser) {
        this.eventDate = eventDate;
        this.eventType = eventType;
        this.secureUser = secureUser;
    }

    public Long getId() {
        return id;
    }

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

    public Date getEventDate() {
        return eventDate;
    }

    public void setEventDate(Date eventDate) {
        this.eventDate = eventDate;
    }

    public EventType getEventType() {
        return eventType;
    }

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

    public SecureUser getSecureUser() {
        return secureUser;
    }

    public void setSecureUser(SecureUser secureUser) {
        this.secureUser = secureUser;
    }
}

@@ -587,22 +587,17 @@
 te Date 
-eventD
+d
 ate;%0A%0A  
@@ -699,23 +699,17 @@
 ureUser 
-secureU
+u
 ser;%0A%0A  
@@ -787,22 +787,17 @@
 nt(Date 
-eventD
+d
 ate, Eve
@@ -817,39 +817,33 @@
 ype, SecureUser 
-secureU
+u
 ser) %7B%0A        t
@@ -846,34 +846,24 @@
    this.
-eventDate = eventD
+date = d
 ate;%0A   
@@ -908,36 +908,24 @@
    this.
-secureUser = secureU
+user = u
 ser;%0A   
@@ -1061,21 +1061,16 @@
 Date get
-Event
 Date() %7B
@@ -1085,22 +1085,17 @@
  return 
-eventD
+d
 ate;%0A   
@@ -1117,21 +1117,16 @@
 void set
-Event
 Date(Dat
@@ -1127,22 +1127,17 @@
 te(Date 
-eventD
+d
 ate) %7B%0A 
@@ -1152,26 +1152,16 @@
 his.
-eventDate = eventD
+date = d
 ate;
@@ -1359,22 +1359,16 @@
 User get
-Secure
 User() %7B
@@ -1383,23 +1383,17 @@
  return 
-secureU
+u
 ser;%0A   
@@ -1415,22 +1415,16 @@
 void set
-Secure
 User(Sec
@@ -1431,23 +1431,17 @@
 ureUser 
-secureU
+u
 ser) %7B%0A 
@@ -1456,28 +1456,16 @@
 his.
-secureUser = secureU
+user = u
 ser;

Rename attributes