In my db schema I have two tables
UserPublisher table : It contains info the number of user profiles the currently loggedIn user follows. A single user follows multiple profiles
Post table : It contains posts which the users post.
Now I want to fetch the posts of the user profiles which the current user follows.
I am using hibernate for object relational mapping.
Presently I am fetching the profiles which the user follows & then running the query on POST table for the list of user profiles.
What this be the best approach? I do have to fire two db queries in this scenario, I was hoping could this be achieved may be in one single query or some other way