KeyedEntity
org.squeryl.KeyedEntity
trait KeyedEntity[K] extends PersistenceStatus
For use with View[A] or Table[A], when A extends KeyedEntity[K], lookup and delete by key become implicitly available Example :
class Peanut(weight: Float) extends KeyedEntity[Long] val peanutJar = Table[Peanut]
Since Peanut extends KeyedEntity the delete(l:Long) method is available
def removePeanut(idOfThePeanut: Long) = peanutJar.delete(idOfThePeanut)
And lookup by id is also implicitly available :
peanutJar.lookup(idOfThePeanut)
Attributes
- Source
- KeyedEntity.scala
- Graph
-
- Supertypes
- Known subtypes
Members list
In this article