public WOActionResults createPaperAction() throws Throwable {
Member presenter = null;
String tokenValue = this.request().cookieValueForKey("wowodcToken");
if (tokenValue != null) {
String username = crypter.decrypt(tokenValue);
presenter = Member.fetchMember(editingContext(), Member.USERNAME.eq(username));
}
if (presenter != null) {
Conference conference = Conference.fetchConference(editingContext(), Conference.NAME.eq("WOWODC 2012"));
ConferenceSession newPresentation = ConferenceSession.createConferenceSession(editingContext(), conference);
newPresentation.addToPresentersRelationship(presenter);
PaperUpdate nextPage = pageWithName(PaperUpdate.class);
nextPage.setConfSessionItem(newPresentation);
return nextPage;
}
return errorResponse(ERXHttpStatusCodes.STATUS_FORBIDDEN);
}
protected EOEditingContext editingContext() {
if (_editingContext == null) {
_editingContext = ERXEC.newEditingContext();
}
return _editingContext;
}
public void setConfSessionItem(ConferenceSession confSessionItem) {
this._confSessionItem = ERXEOControlUtilities.localInstanceOfObject(editingContext(), confSessionItem);
}
Problem is: localInstanceOfObject always returns null... unless that before I'm calling setConfSessionItem, if I call editingContext().saveChanges, now localInstanceOfObject. But I don't want to save the EO before moving to a new EC, so what is the recipe to move an EO to another EC when the EO have not been saved?