1
나는 다음과 같은 방법으로 스프링 RepositoryRestController 있습니다. 봄 부팅 데이터 나머지 포스트 엔티티
예를 들어 Entity 클래스는 다음과 같습니다public Entity {
Long id;
String firstField;
String secondField;
EntityB relatedEntity;
}
게시가 필드에 값을 다음과 같이 법인의 instace에 엔드 포인트 역 직렬화가 발생합니다
{
id: 1,
firstField: "someThing",
secondField: "BUMP",
relatedEntity: "<root>/api/entityB/1:
}
을 엔드 포인트 JSON을 다음
Entity:
id = null
firstfield = "someThing"
secondField = "BUMP",
relatedEntity = instance of EntityB.class with everything related
예상되는 내용은 다음과 같습니다.
Entity:
id = 1
firstfield = "someThing"
secondField = "BUMP",
relatedEntity = instance of EntityB.class with everything related
질문에 ID를 값으로 채우는 방법은 무엇입니까?
_links [self, entity ...]의 모든 조합을 시도했습니다.
정확합니다. 그러나 우리가 ID가 클라이언트 측에서만 자기 url을 드러내지 않는다는 아이디어를 따르면. 저에게 관계 회복을 위해 봄 부츠를 준비하는 방법을 알고 있습니까? – notanormie
이 모양은 다음과 같습니다. https://stackoverflow.com/questions/24936636/while-using-spring-data-rest-after-migrating-an-app-to-spring-boot-i-have-obser – brub
다른 방법으로, exposingIds는 클라이언트에게 보내는 것이지만, 내가 달성하고자하는 것은 ID가있는 JSON에서 객체를 deserialize하는 것입니다. – notanormie