我有两个类Flight和Ticket 。 一个航班可以有很多票,所以Ticket有外键flight_id 。
这是我的数据库,包含flight和ticket 。
这是我的json request (来自Mozilla调试器),我想将其保存在数据库中。
你可以看到flight_id参数,但是我无法将它保存到我的数据库中,我有这样的错误:
at [Source: (PushbackInputStream); line: 1, column: 53] (through reference chain: dto.TicketDto["flight_id"]) DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of at [Source: (PushbackInputStream); line: 1, column: 53] (through reference chain: dto.Ti