Optional column used in foreach

272 views
Skip to first unread message

Richard Rodseth

unread,
Jun 29, 2014, 7:58:21 PM6/29/14
to scala...@googlegroups.com

I've run into the error below, which might be related to this ticket?

https://github.com/slick/slick/issues/549

Is there a workaround? Should I make a synthetic column which gives the optional field a default value like -1 ? 


Here's the error:

Exception in thread "main" scala.slick.SlickException: Caught exception while computing default value for Rep[Option[_]].getOrElse -- This cannot be done lazily when the value is needed on the database side

at scala.slick.compiler.HoistClientOps.rewriteDBSide(HoistClientOps.scala:90)

at scala.slick.compiler.HoistClientOps$$anonfun$rewriteDBSide$1.apply(HoistClientOps.scala:95)

at scala.slick.compiler.HoistClientOps$$anonfun$rewriteDBSide$1.apply(HoistClientOps.scala:95)

at scala.slick.ast.Util$$anonfun$mapOrNone$1.apply(Util.scala:15)

at scala.slick.ast.Util$$anonfun$mapOrNone$1.apply(Util.scala:14)

at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)

Reply all
Reply to author
Forward
0 new messages