Hello
I just need your suggestion on how to approach this.
I have a table of users and table of videos.
Now I want to create concept of Albums. Basically a user can have multiple albums and every album can have multiple videos. So I was thinking of the following:
Create Album table with the following fields:
-Owner: One-to-One mapping with User Table
-Title: String
-Videos: One-to-Many mapping with Video Table
I want to do one call to get all albums that user has and all videos belonging to each Album.
How can I achieve that? I am open to suggestion on changing the format of tables
Yes, it has maximum limit. If you have a large number of objects (for example Video objects) you should fetch it with pagination. Here is documentation with example: Data Relation Paging
Also in this situation you can’t get all of the data with one call because there are maximum limits.
It depends how many albums the user has and how many videos each album has.
If you don’t know exactly how many albums user has (he can create 1 or 100) and how many videos the albums contains, it’s better to use pagination.
Use pagination to fetch all albums of user.
Use pagination to fetch all videos for each album.
In this way you are guaranteed to receive all of the albums and videos and don’t skip any data.