Hi
I have an android app and I want to get some questions for my user to answer which is not already answered by him
there are three tables with 1:n relations
QuestionTABLE
UserTABLE
and AnswerTABEL(or UQ table) which have[ a user column ,a question column , answer column ]
if user answers a question it will be added in a new row in UQ table
How can I achieve this in Backendless Android?
I thought of these but I don’t know how to implement it in backendless:
find all questionS in QUTABLE where user=this
find all/some questions in QuestionTABLE where question is not in questionS
or maybe better approach
find all/some question in QuestionTABLE
where THE question and thisUser in UQ is null
or
where there is no row in UQ table that : theQuestion and thisUser exists
or
where theQuestion and thisUser don’t have a row in UQ table( OR row is null or has null answer)
Hi
This is the code I used :
//////////make the answer
UserAndQuestion userAndQuestion = new UserAndQuestion();
userAndQuestion.setQuestion(question);
userAndQuestion.setAnswer(answer );
userAndQuestion.setUser(user);
////////////make a new row for the answer in table
////////////add relations in response
////////////there are two relations for any answer : one to the question and one to the user
Backendless.Data.of(UserAndQuestion.class).save(userAndQuestion, new AsyncCallback<UserAndQuestion>() { @Override
public void handleResponse(UserAndQuestion response) {