There is a class in Slick ORM called TableQuery. Its companion object has apply method:
def apply[E <: AbstractTable[_]]: TableQuery[E] =
macro TableQueryMacroImpl.apply[E]
I have class Users extends Table that extends AbstractTable so I can write this:
class Users(tag: Tag) extends Table[User](tag, "users") {..some code..}
val query = TableQuery[Users]
I want to generalize work with database so I created class Dao
class Dao[A, B <: AbstractTable[A]] {
private val query = TableQuery[B]
}
Here compiler says: "class type required but B found". When I change B <: AbstractTable[A] to B: ClassTag it doesn't run too.
So what generic type do I have to use to send it to TableQuery?