fixed get WaypointsVisited

This commit is contained in:
grata
2023-05-05 09:27:59 +02:00
parent 66f0e66333
commit d9e90f0874
2 changed files with 10 additions and 7 deletions

View File

@@ -15,10 +15,10 @@ import java.util.Objects;
@IdClass(WaypointsVisitedId.class) @IdClass(WaypointsVisitedId.class)
public class WaypointsVisitedEntity { public class WaypointsVisitedEntity {
@Id @Id
@Column(name = "userId") @Column(name = "user_id")
private int userId; private int userId;
@Id @Id
@Column(name = "waypointId") @Column(name = "waypoint_id")
private int waypointId; private int waypointId;
@Override @Override

View File

@@ -35,12 +35,12 @@ create table if not exists User
primary key (id) primary key (id)
); );
create table if not exists WaypointsVisited create table if not exists Waypoints_visited
( (
userId int not null, user_id int not null,
waypointId int not null, waypoint_id int not null,
foreign key (userId) references User (id), foreign key (user_id) references User (id),
foreign key (waypointId) references Waypoints (id) foreign key (waypoint_id) references Waypoints (id)
); );
@@ -102,3 +102,6 @@ values ('luca.bianchi', 'password');
insert into User (username, password) insert into User (username, password)
values ('giovanni.verdi', 'password'); values ('giovanni.verdi', 'password');
insert into User (username, password, admin) values ('Joe', 'admin', true); insert into User (username, password, admin) values ('Joe', 'admin', true);
insert into Waypoints_visited (user_id, waypoint_id) values (1,1);
insert into Waypoints_visited (user_id, waypoint_id) values (2,2);