francescospangaro / tecnologie-web

Project for the course "Web Technologies" 2022/2023 @ Polimi
1 stars 0 forks source link

Sell page #11

Closed francescospangaro closed 1 year ago

francescospangaro commented 1 year ago

It shows the items in the "Open auction" n times, where N is the number of items in said auction

immagine

Said items are though correctly inserted in the connection db table
immagine

francescospangaro commented 1 year ago

Same error also occurs in the auction details page, i'm guessing a mighty copy and paste

Furrrlo commented 1 year ago

It's not by the number of items, it's by the number of users, cause if you look here https://github.com/Furrrlo/tecnologie-web/blob/39dee1ba6767f18dae27683285a5c518dc1d7dc7/src/main/java/it/polimi/webapp/dao/AuctionDao.java#L23-L35 you pull in the 'utente' table without putting in the join condition.

We are basically learning the hard way why you should prefer joins to cartesian products, cause it's way easier to mess those up. We snhould prob switch to joins 🌵

francescospangaro commented 1 year ago

... will replace every cartesian with a join