0

Let say i have a business domain in which there are two entities, Survey and Question, in OOP terms, the Survey has QuestionsList, the greenDao generation getQuestions method which returns a list of questions resolving 1:M relation from Survey to Question, but there is no method like setQuestions( questionList) which will take a list of question to update. How can i update the questionList for the Survey entity ?

Abdul Samad
  • 526
  • 5
  • 13

1 Answers1

1

you can use:

getQuestions().add(Question);

but for setting Question parent you should set ParentId for your Question and then add it to QuestionList of Survey. ParentId is the foreign-key of Question which links a question to a survey. Remember that you must store Question after these changes.

SerCna
  • 278
  • 2
  • 12
  • Thank you for the help, so you are suggesting something like the CoreData( in IOS) functionality. Will try it out. – Abdul Samad Aug 25 '14 at 04:55