tuvarna-coursework / transport-system-management

2 stars 2 forks source link

[DATABASE] Reconsider Ticket mapping #16

Closed MaximilianGeorgiev closed 3 years ago

MaximilianGeorgiev commented 3 years ago

Currently ticket has two foreign keys: user_id and trip_id but a trip can belong to another ticket as well and a OneToOne relation is not suitable. Hibernate does a outer left join when querying and throws exception that there are duplicate entities with the same PK.

MaximilianGeorgiev commented 3 years ago

Created and handled joined table UserTicket with commit c2351eac3effcdff86dd65f062fcf375d9c81cd8