I may be possible with your approach, I don't have enough knowledge to say it can't, but it sounds a bit fishy and overly complicated. What I did was using the same approach I used here, that is define a method that takes a T#TableElementType
(that would be a row object) and a TableQuery
object and do some generic operations:
def autoIncInsert[T <: BaseScheme[_]](row: T#TableElementType, tableReference: TableQuery[T])(implicit s: Session) = {
(tableReference returning tableReference.map(_.id)) += row
}
Then as type T
you should pass SomeEntityScheme
class.
This should solve your problem in a more coincise and simple way in my opinion.