fix Id in WaypointsVisitedEntity
This commit is contained in:
@@ -3,8 +3,8 @@ package ch.progetto152.entity;
|
|||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -12,12 +12,11 @@ import java.util.Objects;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@ToString
|
@ToString
|
||||||
@Table(name = "WaypointsVisited", schema = "Progetto152", catalog = "")
|
@Table(name = "WaypointsVisited", schema = "Progetto152", catalog = "")
|
||||||
|
@IdClass(WaypointsVisitedId.class)
|
||||||
public class WaypointsVisitedEntity {
|
public class WaypointsVisitedEntity {
|
||||||
@Basic
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "userId")
|
@Column(name = "userId")
|
||||||
private int userId;
|
private int userId;
|
||||||
@Basic
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "waypointId")
|
@Column(name = "waypointId")
|
||||||
private int waypointId;
|
private int waypointId;
|
||||||
@@ -39,3 +38,8 @@ public class WaypointsVisitedEntity {
|
|||||||
return Objects.hash(userId, waypointId);
|
return Objects.hash(userId, waypointId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class WaypointsVisitedId implements Serializable {
|
||||||
|
private int userId;
|
||||||
|
private int waypointId;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user