0

Using Play 2 / Scala , casbah and Salat

abstract class BaseQuestion(val data:String,val responses:List[StudentResponse] = Nil){
  val key:String = UUID.randomUUID().toString
}

case class Question(override val data:String, val questionType:String = "MCQ", val choices:List[String] = Nil,
                    val answer:String,override val responses:List[StudentResponse])
  extends BaseQuestion(data = data,responses = responses)

However when I use SalatDAO.save, and check the mongo database the property key is not being stored in the Mongo database Object.

Not sure what the problem is.

Thank you in advance.

Nepoxx
  • 4,849
  • 5
  • 42
  • 61
smk
  • 5,340
  • 5
  • 27
  • 41

1 Answers1

1

You need to annotate property key with @Persist

https://github.com/novus/salat/wiki/Annotations

prasinous
  • 798
  • 3
  • 6