Skip to content

Instantly share code, notes, and snippets.

@mbseid
Created June 10, 2013 14:44
Show Gist options
  • Save mbseid/5749281 to your computer and use it in GitHub Desktop.
Save mbseid/5749281 to your computer and use it in GitHub Desktop.
Using Salat References
case class Author(id:ObjectId, name:String)
case class Book(id:ObjectId, name:String, authorId:ObjectId){
//For eager relationship
val author = Author.findOneById(authorId)
//For lazy relationship
lazy val author = Author.findOneById(authorId)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment