I followed the following steps:
- Ran
sbt new playframework/play-scala-seed.g8to create new service of Play framework - Added the line
libraryDependencies += "org.squeryl" %% "squeryl" % "0.9.14"to my build.xml file (0.9.14 because that version is compatible with my scala version 2.13.1 as per https://mvnrepository.com/artifact/org.squeryl/squeryl) - ran
sbt runwhich installed all dependencies.localhost:9000opens fine without any errors. Added a file
MyEntity.scalawith the following content:import org.squeryl.{KeyedEntity, Schema, Table} import org.squeryl.annotations.Column case class MyEntity( @Column("id") id: Int = 0, @Column("name") name: String, ) extends KeyedEntity[Int] { def this() = this(0, "") } object MyEntitySchema extends Schema { val myEntities: Table[MyEntity] = table[MyEntity]("myEntities") }Added another file
MyEntityRetrieval.scalawith the following content:import org.squeryl.PrimitiveTypeMode._ import scala.util.Try class MyEntityRetrieval { def get(key: Int) : Option[MyEntity] = inTransaction { Try(Some(myEntities.get(key))).getOrElse(None) } }sbt run. No errors. Opened localhost. Showing error:could not find implicit value for parameter fieldMapper: org.squeryl.internals.FieldMapper.- Searched in Google. Didn't find anything useful.
How do I fix this? Any kind of help would be highly appreciated. Thanks in advance.
Try adding the following import to the top of
MyEntity.scala: