Hallo everyone,
I am trying to make a new POST to add data at the same time at two tables.
{
"fname":"Chris",
"lname":"Ray",
("DataClassOne"
,"DataClassTwo" )
"order" : ["grocery_store" ,"apple","1"]
}
I would like to fulfil my list from 2 different tables. First , I thought to make a new class DTO with the data I would like to use. Then , I make a List<DTOClass> on my CreateDTO. I did it in this way, because it is possible to have more than one product, or store at one order. But it doesn't work . Any ideas to change it ?
I thought to make a class DTO which have the data
POST Method
w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `com.demo..dto.` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from
String value ('.'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.demo..dto.` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('.')
at [Source: (PushbackInputStream); line: 7, column: 16] (through reference chain: com.demo..dto.[""]->java.util.ArrayList[0])]