Seb777
(Seb)
March 7, 2023, 9:39pm
1
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.
Seb777
(Seb)
March 8, 2023, 2:52pm
3
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
Seb777
(Seb)
March 9, 2023, 6:41pm
5
Seb777
(Seb)
March 10, 2023, 8:12am
6
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.