I'm quite new to Scala and need to use slick to build a table mapping for these case classes.
I can do it for a simple case class but the nesting and option parameters are leaving me confused how to do this?
case class Info(fullName: Option[String], dn: Option[String], manager: Option[String], title: Option[String], group: Option[String], sid: Option[String])
case class User(username: String, RiskScore: Float, averageRiskScore: Float, lastSessionId: String, lastActivityTime: Long, info: Info)
I need to end up with a simple table which contains all of the combined parameters.
Given your nested case class definitions, a bidirectional mapping for the
*
projection similar to the following should work:Here is a great relevant Slick article you might find useful.