Advertisement
NLinker

Select in scalikejdbc

May 13th, 2015
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.59 KB | None | 0 0
  1.   def selectComponents(customerIdx: String)
  2.                       (implicit session: DBSession):
  3.   List[(Int, Array[String], String)] = {
  4.     val nodeTypeId = NodeType.predefComponent.id
  5.     //noinspection RedundantBlock
  6.     val sql: SQL[Nothing, NoExtractor] = sql"""
  7.        SELECT id, path, text_id FROM eden2.node
  8.          WHERE node_type_id = ${nodeTypeId}
  9.      """
  10.     //add? JOIN FleetDataSet fdsx ON cx.index = fdsx.customer_index
  11.     val triples = sql.map(rs ⇒
  12.       (rs.int("id"), rs.string("path").split("\\."), rs.string("text_id"))
  13.     ).list().apply()
  14.     triples
  15.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement