I have the following case class (note the Option in the last field)
case class BranchVO(sk: Int, name: String, bankSk: Int, bankName: Option[String])
And the following class to have Slick access the database (Note the None in the * method, as the case class has an additional last field):
class BranchDB(tag: Tag) extends Table[BranchVO](tag, "branches") {
def sk: Rep[Int] = column[Int]("sk", O.PrimaryKey, O.AutoInc)
def name: Rep[String] = column[String]("name")
def bankSk: Rep[Int] = column[Int]("bank_sk")
def * = (sk, name, bankSk, None) <> (BranchVO.tupled, BranchVO.unapply)
}
When I attempt to update a row in Slick, I get slick.SlickException: A query for an UPDATE statement must select table columns only -- Unsupported shape: ProductNode
I need the case class to have the last field. I could solve this problem creating yet another case class without the last field, but I'm trying to avoid that, is there a workaround?