0
웹 서비스를 통해 다음 JSON을 읽습니다. json을 적절한 POJO로 읽는 방법이 있습니까? POJO는 최대 절전 모드에 의해 생성되며 데이터베이스와 통신하는 데 사용됩니다.웹 서비스를 통해 JSON을 최대 절전 모드로 주석 처리 된 POJO로 읽음
기본적 I는 N Perso
POJO, Pet
POJO를 세트로 pets
JSON 및 Toy
POJO를 세트로 toy
JSON로 person
JSON을 판독 할 필요가있다.
json으로
{
"person":{"first_name":"John", "last_name":"Smith"},
"pets":[{"species":"dog", "name":"Adama"}, {"species":"cat", "name":"Benton"} ],
"toys":[{"car":"corvet", "color":"black"}, {"action_figure":"hancock", "height":"1ft"} ]
}
웹 서비스
@Post
public Representation readForm(Representation representation) {
try {
Person aPerson = …
Set<Pet> petSet = …
Set<Toy> toySet = ...
….