Is my relationships mapping correct?

Hi,

I have lost touch of relationships mapping in JPA because I didn’t have chance to work on JPA for many years, so I hope I can get some feedback on my entities’ mapping because I still need to know how Springboot works which makes me crazy…

The use case is based on

Here’s my relationship mapping:
pet entitiy - https://pastebin.pl/view/a26e1af8
order entity - https://pastebin.pl/view/3cc0a0c1
user entity - https://pastebin.pl/view/1ef7ed6f
photo entity - https://pastebin.pl/view/1d69cb31
category entity - https://pastebin.pl/view/8e790749 - not sure if I have to create a one to many here?

Thank you.,

Nobody other than you can tell if your mapping is correct :wink:

You can always declare bi-directional associations if you want, usually they help with querying from the other side, but it’s not required. I’d suggest, add the inverse relationship when you see the need.