我想知道在哪里可以找到这样的代码引发的异常:
def readFromDB: String = {
db_sqlite_xml.withSession {
implicit db: Session =>
xmlQuery.first.text
}
}
我在光滑的 scaladoc ( http://slick.typesafe.com/doc/2.0.1/api/#package )中找不到它;我在 javadoc 的 tableQuery 类中搜索了方法“first”,但没有任何成功。
谢谢。
奥利维尔
ps:这是我的答案,它正在工作:
def readFromDB: String = {
db_sqlite_xml.withSession {
implicit db: Session =>
xmlQuery.firstOption.map(u=>u.text).getOrElse("")
}
}
}
感谢您的回答,它帮助了我。