ForeignKeyDeclaration are to be manipulated only during the Schema definition (this is why all public methods have the implicit arg (implicit ev: Schema))
For use with View[A] or Table[A], when A extends KeyedEntity[K], lookup and delete by key become implicitly available Example :
This class can be used for read only tables or (database) views for an updatable view, or table use Table[T]
This factory is meant to use POSOs (Plain old Scala Objects), i.
This factory is meant to use POSOs (Plain old Scala Objects), i.e. your object use Scala's primitive types to map to columns. This can have a significant performance advantage over using object types i.e. a result set of N rows of objects with M field will generate N * M objects for the garbage collector, while POSOs with primitive types will each count for 1 for the garbage collector (to be more precise, String and Option[] fields will add a +1 in both cases, but a custom String wrapper will also add one ref, for a total of 2 refs vs a single ref per string column for the POSO). This lightweight strategy has a cost : constants and object field references cannot distinguish at compile time, so this mode is less 'strict' than one with a CustomType
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)