This page is no longer maintained — Please continue to the home page at

Help with parameterized types and Squeryl

No replies
Nolan Darilek
Joined: 2009-10-11,
User offline. Last seen 42 years 45 weeks ago.

I have a Model class which I use to define a few common fields, methods
and other behaviors. I define it like so:

trait Model[OwnerType <: Record[OwnerType]] extends KeyedEntity[String] {
self: OwnerType =>

def table: Table[OwnerType]

object id extends StringField(this.asInstanceOf[OwnerType], 36) {
override def defaultValue = newID


def save = {

def delete_! = table.deleteWhere( === id)


When I try compiling that, though, I get:

Cannot prove that OwnerType <:< org.squeryl.KeyedEntity[_].
[error] table.update(this)
[error] ^

Same with the delete_! method.

How do I tweak my parameterized types to fix this? I have a hard time
wrapping my head around that aspect of Scala.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland