Problems with custom mappings

37 views
Skip to first unread message

Ivan Grebenik

unread,
Nov 25, 2015, 10:33:25 AM11/25/15
to Slick / ScalaQuery
Hello there!

I have few error compilations that I cannot deal with. So any help is appreciated!

Here is a code:

 7 trait SlidesSchema { this: DriverComponent =>

  8   import SlideSchema._

  9   import driver.simple._

 10 

 11   class SlideSetTable(t: Tag) extends Table[SlideSet](t, "SLIDE_SET") {

 12     val id = column[?[UUID]]("SET_ID", O.PrimaryKey)

 13     val title = column[String]("TITLE")

 14     val description = column[String]("DESCRIPTION")

 15     val course = column[UUID]("COURSE_ID")

 16     val logo = column[?[String]]("LOGO")

 17     val isTemplate = column[Boolean]("IS_TEMPLATE")

 18     val selectedContinuity = column[Boolean]("IS_SELECTED_CONTINUITY")

 19      val theme = column[?[UUID]]("THEME_ID")

 20     val duration = column[?[Long]]("DURATION")

 21     val scoreLimit = column[?[Double]]("SCORE_LIMIT")

 22     val slidesNumber = column[?[Long]]("SLIDES_NUMBER")

 23 

 24     def * = (

 25       id, title, description, course, logo, isTemplate,

 26       selectedContinuity, theme, duration, scoreLimit, slidesNumber

 27     ).shaped[SlideSetRow] <> (buildSet, extractSet)

 28   }

 29 }

 30 

 31 object SlideSchema {

 32 

 33   type SlideSetRow = (?[UUID], String, String, UUID, ?[String], Boolean, Boolean, ?[UUID], ?[Long], ?[Double], ?[Long])

 34 

 35   val buildSet: SlideSetRow => SlideSet = { r: SlideSetRow =>

 36     SlideSet(

 37       id = r._1, title = r._2, description = r._3, course = r._4,

 38       logo = r._5, isTemplate = r._6, isSelectedContinuity = r._7,

 39       theme = r._8, duration = r._9, scoreLimit = r._10, slidesNumber = r._11)

 40   }

 41 

 42   val extractSet: SlideSet => ?[SlideSetRow] = { s: SlideSet => (

 43       s.id, s.title, s.description, s.course, s.logo, s.isTemplate,

 44       s.isSelectedContinuity, s.theme, s.duration, s.scoreLimit, s.slidesNumber

 45     ).toOption

 46   }                                                                                                                                                                           

47 }



And here is SlideSet definition:
5 case class SlideSet(
6   id: Option[UUID] = None,
7   title: String = "",
8   description: String = "",
9   course: UUID,
10   logo: Option[String] = None,
11   slides: Seq[Slide] = Seq(),
12   isTemplate: Boolean = false,
13   isSelectedContinuity: Boolean = false,
14   theme: Option[UUID] = None,
15   duration: Option[Long] = None,
16   scoreLimit: Option[Double] = None,
17   slidesNumber: Option[Long] = None
18 ) 

Okay, so for quite good but during compilation I get the errors:

[queryable:valamis-studio-slides]> compile
[info] Formatting 1 Scala source {file:/Users/igrebenik/Workspace/github/valamis-enhancement/}queryable(compile) ...
[info] Reformatted 1 Scala source {file:/Users/igrebenik/Workspace/github/valamis-enhancement/}queryable(compile).
[info] Compiling 3 Scala sources to /Users/igrebenik/Workspace/github/valamis-enhancement/valamis-queryable/target/scala-2.11/classes...
[error] /Users/igrebenik/Workspace/github/valamis-enhancement/valamis-queryable/src/main/scala/com/arcusys/valamis/queryable/slides/SlidesSchema.scala:24: Could not inline required method anyToToShapedValue because callee has no code.
[error]     def * = (
[error]             ^
[error] /Users/igrebenik/Workspace/github/valamis-enhancement/valamis-queryable/src/main/scala/com/arcusys/valamis/queryable/slides/SlidesSchema.scala:27: Could not inline required method columnShape because callee has no code.
[error]     ).shaped[SlideSetRow] <> (buildSet, extractSet)
[error]             ^
[error] /Users/igrebenik/Workspace/github/valamis-enhancement/valamis-queryable/src/main/scala/com/arcusys/valamis/queryable/slides/SlidesSchema.scala:27: At the end of the day, could not inline @inline-marked method <>
[error]     ).shaped[SlideSetRow] <> (buildSet, extractSet)
[error]                           ^
[error] three errors found
[error] (queryable/compile:compileIncremental) Compilation failed
[error] Total time: 1 s, completed 25.11.2015 18:32:19
[queryable:valamis-studio-slides]>


Could anyone explain me the cause of this errors?

Reply all
Reply to author
Forward
0 new messages