Answer the question
In order to leave comments, you need to log in
How to organize automatic recording in JPA?
Hello, I started to study web development in the java language, the task was to write an application without using frameworks, the question arose of how to use Hibernate and JPA to organize Writing to data so that when writing to one table where there is a one-to-many relationship, there was a record in another table n
For example we have a test table and a question table. how to make it so that when adding a test, new questions automatically fall into the table.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Something like this:
@ManyToOne(cascade=CascadeType.PERSIST)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question