I need to perform a delete on the db, of the questionnaire response about a given product id.
What do you think it is better between the following options that I thought:
Deleting directly the questionnaire in the database with a named query. This would work becaue when you are retrieving the questionnaire, you will query the database (so, it is all up to date), and because the cascade type includes the refresh;
Deleting entities with a pattern similar to Remove - select - Remove and then flushing changes to the database (Ref. to page 23 of the set of slides 05-4-JPA-JPQL for further information about the pattern)
In case, we need to agree on the decision for the final evaluation of the project.
Here my consideration:
This could be better in terms of readability of the code, we would have a more thin code;
I think that this is more "JPA style", could lead to a little bit less immediate code, but more appreciable
I need to perform a delete on the db, of the questionnaire response about a given product id. What do you think it is better between the following options that I thought:
In case, we need to agree on the decision for the final evaluation of the project. Here my consideration: