Skip to content

Instantly share code, notes, and snippets.

@nuboat
Created June 4, 2015 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuboat/cb9c614dba747ace3fcc to your computer and use it in GitHub Desktop.
Save nuboat/cb9c614dba747ace3fcc to your computer and use it in GitHub Desktop.
Query with cache
...
def groupJobLevel(): List[GroupJobLevel] = {
val cache = Cache.get("GROUPJOBLEVEL")
if (cache.isDefined) {
return cache.get.asInstanceOf[List[GroupJobLevel]]
}
val result = queryGroupJobLevel()
if (result != null) {
Cache.set("GROUPJOBLEVEL", result)
}
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment