0

I wark on spring rest API project where I have to insert Model and this model has realtion with other table (one-to-many) and I am using jdbcTemaple for some resons.

The api client send json object and it have list of the reated object.

How I can Insert this object in DB.

for eaxample client send this DTO:

{
 "name": "Join"
 "courses: [
  {
   "id" : 1,
   "courseName":"Phisics"
  },
 {
  "id" : 2,
  "courseName":"Chemistry"
 }
]
  • Does this answer your question? [How to execute INSERT statement using JdbcTemplate class from Spring Framework](https://stackoverflow.com/questions/5026943/how-to-execute-insert-statement-using-jdbctemplate-class-from-spring-framework) – fujy Nov 23 '21 at 16:30
  • @fujy sorry No. – Mahmood Nov 23 '21 at 16:50
  • @fujy No this is only insert in one table I want to insert into two related table in same time – Mahmood Mar 15 '22 at 09:33

0 Answers0