Created
June 10, 2013 14:44
-
-
Save mbseid/5749281 to your computer and use it in GitHub Desktop.
Using Salat References
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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