Skip to content

Instantly share code, notes, and snippets.

@remeniuk
Created December 26, 2011 15:25
Show Gist options
  • Save remeniuk/1521387 to your computer and use it in GitHub Desktop.
Save remeniuk/1521387 to your computer and use it in GitHub Desktop.
trait IdeaBoxDao {
def getTopicById(id:String):Topic
}
class IdeaBoxDaoImpl extends IdeaBoxDao{
val sqlMap = new SqlSessionFactoryBuilder().build(
Resources.getResourceAsReader("ibatis/SqlMapConfig.xml"))
def getTopicById(id:String):Topic = {
val session = sqlMap.openSession()
try{
session.selectOne("com.vasilrem.ideabox.model.TopicMapper.getTopic", id).asInstanceOf[Topic]
}finally {
session.close
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment