tldr
tldr

Reputation: 12112

Play Framework - save()

The save() method is used only to add an entry to the db, not when it is modified. Eg., when I create a question, I do question.save. When I add an answer to the question, I just do question.add(answer). I don't have to save() the question to save the changes. Is my understanding correct?

Upvotes: 1

Views: 2687

Answers (2)

Codemwnci
Codemwnci

Reputation: 54914

Play uses save() regardless of whether it is new or existing model. It manages all the complexity of this for you behind the scenes.

Upvotes: 2

emt14
emt14

Reputation: 4896

Yes you do need to save your question. Play has some pretty good tutorials, you should have a look.

Upvotes: 1

Related Questions