Changed date to PRIMARY KEY

This commit is contained in:
Marc Beyer 2021-11-28 15:13:31 +01:00
parent f0e89184a4
commit 8ffaf525eb
2 changed files with 12 additions and 0 deletions

View File

@ -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;
/*********************

View File

@ -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;
}
}