• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

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

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

I refer to the project below:

https://projects.spring.io/spring-petclinic/#quick-start

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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic