• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • 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: 730
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Seriously? That's what you're going with? I prefer this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic