Can I get some thoughts on the entity design?
Let's say I have an entity called Book. Let's say I create a specific instance of that book. It has a title A and an author B. Since there can be multiple books, should the amount be included in the entity OR should I instead create a separate entry for each of the same book in my database ?
So in each case, if the amount of books were 30, database would look respectively:
id = 1, title = A, author = B, amount = 30;
vs
id = 1, title = A, author = B;
id = 2, title = A, author = B;
...
id = 30, title = A, author = B;
Which method (if any) is considered a good practice? Since in this case there may be multiple identical books and I may want to update them, having one entry in database which would include the amount seems easier to update than n amount of db entries which only differ by id (every other data for that specific book being identical).
I am developing using Java and Spring Boot if that matters.
EDIT: all the answers I have received were very helpful to me. Too bad I can't accept all of them as an answer so I will have to go with the seniority!