Hi there!
I’m trying to migrate from 3 to 4.0 beta and I’m having difficulty with object relations.
Look this sample code:
try {
Session session = new Session();
session.setInitialPage(Integer.parseInt(txtInititalPage.getValue()));
session.setName(txtName.getValue());
if (_publication.getSessions() == null) {
_publication.setSessions(new ArrayList<>());
}
_publication.getSessions().add(session);
_publication = Backendless.Persistence.of(Publication.class).save( _publication );
refreshContainer();
} catch (Exception e) {
e.printStackTrace();
}
In Backendless 3, this code works very well: when I save the object _publication Backendless creates or updates all Session objects contained in _publication.getSessions().
In Backendless 4, the sessions are not saved and Backendless return _publication with sessions field null.
What I suppose to do in Backendless 4?
Thank you a lot.