diff --git a/server/src/main/java/com/vpr/server/UserEvent.java b/server/src/main/java/com/vpr/server/UserEvent.java index d86c473..3cc2582 100644 --- a/server/src/main/java/com/vpr/server/UserEvent.java +++ b/server/src/main/java/com/vpr/server/UserEvent.java @@ -20,6 +20,8 @@ public class UserEvent { @JoinColumn(name = "event_id", referencedColumnName = "id") private Event event; + @Id + @Column(name="date", columnDefinition = "DATE DEFAULT CURRENT_DATE", nullable = false) private Date date; /********************* diff --git a/server/src/main/java/com/vpr/server/UserEventId.java b/server/src/main/java/com/vpr/server/UserEventId.java index 5e3d517..d8e1009 100644 --- a/server/src/main/java/com/vpr/server/UserEventId.java +++ b/server/src/main/java/com/vpr/server/UserEventId.java @@ -1,10 +1,12 @@ package com.vpr.server; import java.io.Serializable; +import java.sql.Date; public class UserEventId implements Serializable { private long user; private long event; + private Date date; /********************* * Getter and Setter * @@ -25,4 +27,12 @@ public class UserEventId implements Serializable { public void setEvent(long event) { this.event = event; } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } }