In Scala, I have the following scala case class:
case class Page(url: String)
object Page {
implicit val personFormat = Json.format[Page]
}
Which is encoded in the database like this:
object Db extends Instance(entities = Seq(Entity[Page]()), url="jdbc:h2:mem:test")
Afterwards, I retrieve one instance from the database like this:
val page = Db.query[Page].whereEqual("id", pageId).fetch
val content: String = new URL(page.url).getContent().toString
However, on the last line I am getting.
value url is not a member of Stream[models.Page with sorm.Persisted]
Why is url not a member?
I created a database representation for Page. Shouldn't that include all its fields?
It should be like this