• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

Should I use One-to-Many and Many-to-One or leave them out for flexibility in SpringBoot JPA app ?

Ranch Hand
Posts: 669
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,

I refer to the project below:


And here's my database schema which I am abit uncertain if it is correct :

My question is
1) Is the above schema correct? Should I leave out reference foreign key in SpringBoot JPA web app?
2) do I need to use One-to-Many and Many-to-One to annotate the entities if the case applies? cos we can always us Join Column at the query in the Repository or Service layer for greater flexibity and perhaps 'optimization' ?
3) if the variables/attributes/fields and the names in my entity class are the same, I do not have to put @column right ?

Thank you for your help.

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic