DeepSave with custom class not updating relation

Hello,

In java, when I find a custom class with relations

Backendless.Data.mapTableToClass(Relation.class.getSimpleName(), Relation.class);

Users user = Backendless.Data.of(Users.class)
                    .find(DataQueryBuilder.create()
                            .setRelated("relations")
                     .setWhereClause("customerId ='"+customer+"'"))
...

And make a deepSave of “user” I have the following error:

 "Type:\"java.lang.RuntimeException\", Description:\" Deep save exception. Duplicate value 'dqfd546_df4sd684gf6g' for column 'id'\"

The deepSave tries to insert the relation while it is an existing one.

Thank you

Hi. Did i understood correctly, that you save the User object, which you found in previous request?
If so, the behavior is expected, because the server tries create all the objects which are present in sent payload.
You have to create objects and then attach the existed relations.

Hi @oleg-vyalyh

But here Update Parent and Child - Backendless SDK for Android/Java API Documentation, it explains that it is possible to update parent and child in a raw with deepSave.

Or am I missing something ?

Thank you

Hi @Seb777

I’ve created a ticket BKNDLSS-31692 to investigate the issue

Regards,
Vlad

Thank you @vladimir-upirov !

Hello @vladimir-upirov

I found the solution. The problem came from the Relation object which did not contain the objectId property.

My fault, sorry to have disturbed you.