Answer the question
In order to leave comments, you need to log in
Is there a need to bind entities in the DB if I bind them via spring data jpa in code?
I am writing a non-commercial application for myself. It is a normal work log.
There are columns:
the name of the transport, the names of the workers, the authorities, the name of the agent, the name of the customer.
I think the question is clear. Is it worth bothering and linking through table keys in sql, or can it be linked in the code itself through annotations? What are the consequences of such a connection? What are the nuances?
ps I'm a newbie, absorbing information.
Answer the question
In order to leave comments, you need to log in
Good afternoon!
название транспорта, фамилии рабочих, инстанции, фамилия агента, фамилия заказчика.
Is it worth bothering and linking through table keys in sql, or can it be linked in the code itself through annotations?
What are the consequences of such a connection?
What are the nuances?
If you mean whether you need constraints in the database, then no, not necessarily. They are needed to guarantee the integrity of the data in the database and as a means of documentation. While the program is working correctly, what they are, what they are not. At one point, your program or a third-party program will start writing garbage to the database, and with constraints you will catch it very quickly. Without them, everything will start to crumble, since JPA expects an associated object and there is null.
If you mean whether primary and third-party keys are needed in the tablets, then most likely yes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question