Iam 여기에 붙어 있습니다! 어떤 도움을 주시면 감사하겠습니다.RequestFactory 및 @OneToMany 연결
제 경우는 제 모듈에 @OneToMany 연관이 있습니다.
class Parent{
@OneToMany(
mappedBy="parent"
)
return List<Child> getChildren();
}
class Child{
@ManyToOne
return Parent getParent();
}
클라이언트 측에서 전체 객체 맵을 얻고 싶습니다.
은 내가 (디스플레이로 데이터 그리드와 AsyncDataProvider)이 작업을 수행 :
requestContext.getParents().with("children").fire(new Receiver<CallbackProxy>() {
@Override
public void onSuccess(CallbackProxy response) {
display.setRowData(range.getStart(),response.getParents());
updateRowCount(response.getCount().intValue(), true);
}
});
내 DAO의 단지 쿼리 전체지도를.
Criteria criteria = session.createCriteria(Parent.class);
criteria.setFetchMode("children", FetchMode.JOIN);
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
/* we got all the map here on the server side */
Callback callback = new Callback();
callback.setCount(count);
callback.setParents(criteria.list());
return callback;
하지만 아이를 가질 수 없습니다. 이들의 목록은 null입니다. with with iam with with "children"
고맙습니다.
제 문제는 결과를 ValueProxy로 랩핑하고 결과 프록시로 속성을 ("") 찾는 것 같습니다. –