Relations in 4.0.0-beta3

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.

Hi Alexandre,
Establishing and deleting relationships in Backendless 4 works differently than in 3.x. Please see the documentation for details:
https://backendless.com/docs/android/doc.html#related_objects
Regards,
Mark

I see. I just made the changes and it’s working now. Personally, I think that the old method is more convenient, but ok. Thank you for the help! =)