It hard to describe but easy to understand by checking my attached photo.
I want to delete those unlinked items.
Please help~
Thanks
Hi Chechia,
I can suggest you the next steps to solve this issue. It’ll be working fine if you have the one-to-one relation between your tables.
- collect all rows of table ‘User_backendless’ which do not have the relation to parent table (use the method ‘find’ with where clause ‘backendless_project_save[user_back].objectId is null’)
- loop the collection and remove each row (use method ‘remove’)
Regards Ilya
It works fine! Thanks your answer! Very great!
The code is following like this:
new Thread(new Runnable() {
@Override
public void run() {
String whereClause = “backness_project_save[user_back].objectId is null”;
BackendlessDataQuery dataQuery = new BackendlessDataQuery();
dataQuery.setWhereClause( whereClause ); BackendlessCollection collection = Backendless.Data.of( User_backendness.class ).find(dataQuery);
List<User_backendness> mUser_backendnesses=collection.getCurrentPage();
for(User_backendness mUser_backendness:mUser_backendnesses ){
Log.d(“Null_objectId”,mUser_backendness.getObjectId()+"");
}
}
}).start();