Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

spring boot rest controller, returning many objects/queries

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm writing my first spring boot/hibernate/jpa web app using rest controllers. I'm basically following along online resources such as
this tutorial

My question is, using that particular tutorial as an example, in a case where I make a rest call to the controller:



but in addition to the list of notes that that function returns, I also want a list of most recent comments, recently viewed notes, maybe update some info re: the users status....how do I combine all that info?

Do I use a master controller that has multiple @Auitowired repositories?

thanks!
 
Rancher
Posts: 527
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are doing a simple project that you will not require maintenance then you could put all of those in a 'master' controller if you want.  It isn't a good design though. if you put logic combining that data into the controller, then what if you want to get the combined data in another controller or another service?
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic