का जीडब्ल्यूटी सीरियलाइजेशन मेरे पास आरपीसी सेवा है जो गेमइवेंट प्रकार का ऑब्जेक्ट देता है जो ईवेंट (सार) से फैली हुई है। जब मुझे क्लाइंट पक्ष पर ऑब्जेक्ट मिलता है, तो ईवेंट (eventId, copyEventId, gameTimeGMT) से विरासत में प्राप्त सभी गुण null
पर सेट होते हैं जबकि सर्वर पक्ष पर, इन गुणों के मान होते हैं।एक सबक्लास
public class GameEvent extends Event implements IsSerializable {
private String homeTeam;
private String awayTeam;
public GameEvent() {
}
}
// Annotation are from the twig-persist framework which should not
// impact the serialization process.
public abstract class Event implements IsSerializable {
@Key
protected String eventId;
@Index
protected String copyEventId;
protected Date gameTimeGMT;
protected Event() {
}
}
अपडेट: मैं gwt-platform फ्रेमवर्क (एमवीपी कार्यान्वयन) का उपयोग करता हूं। यहां सेवा क्लाइंट पक्ष की कॉल है। result.getGE()
GameEvent ऑब्जेक्ट देता है लेकिन null
गुणों के साथ।
dispatcher.execute(
new GetFormattedEventAction(
id),
new AsyncCallback<GetFormattedEventResult>() {
@Override
public void onFailure(Throwable caught) {
caught.printStackTrace();
}
@Override
public void onSuccess(
GetFormattedEventResult result) {
FormattedGameEvent formattedGameEvent = new FormattedGameEvent(
result.getGE());
}
});
कार्रवाई हैंडलर:
public class GetFormattedEventActionHandler implements
ActionHandler<GetFormattedEventAction, GetFormattedEventResult> {
@Override
public GetFormattedEventResult execute(GetFormattedEventAction action,
ExecutionContext context) throws ActionException {
GameEvent gameEvent = null;
QueryResultIterator<GameEvent> rs = datastore.find().type(
GameEvent.class).addFilter("copyEventId", FilterOperator.EQUAL,
action.getEventId()).returnResultsNow();
if (rs.hasNext()) {
gameEvent = rs.next();
}
return new GetFormattedEventResult(gameEvent);
}
}
परिणाम:
public class GetFormattedEventResult implements Result {
private GameEvent e;
@SuppressWarnings("unused")
private GetFormattedEventResult() {
}
public GetFormattedEventResult(GameEvent gameEvent) {
e = gameEvent;
}
public GameEvent getGE() {
return e;
}
}
प्रश्न को अद्यतन किया गया। जीडब्ल्यूटी को चालित करने की भी कोशिश की लेकिन यह काम नहीं कर रहा है। – Sydney
गेमइवेंट में ऐसे प्रकार के गुण थे जो IsSerializable को लागू नहीं करते थे, यही कारण है कि यह धारावाहिक श्वेतसूची में नहीं था। – Sydney
आह, यह समझ में आता है। क्षमा करें मैं और मदद नहीं कर सका। हालांकि, जीडब्ल्यूटीसी को इसके बारे में एक चेतावनी जारी करनी चाहिए थी। –