139140141142143144145146147148149150151152153154
User user = new User(); user.setId(2434L); user.setName("Pengtao"); so2.setUser(user); Book book = new Book(); book.setId(23424); book.setPrice(3.4); book.setSell(true); book.setText("cccccccc"); book.setTitle("ddddd"); so2.setBook(book); String jsonStr = Json.toJson(so2); SimpleObj2 temp = Json.toObject(jsonStr, SimpleObj2.class);