Skip to content

Instantly share code, notes, and snippets.

@amazari
Created March 12, 2013 11:43
Show Gist options
  • Save amazari/5142273 to your computer and use it in GitHub Desktop.
Save amazari/5142273 to your computer and use it in GitHub Desktop.
trait ModelService[T] {
val selectAll = Queryable[T] // Compiler error : No TypeTag for T, plus issues with "evidences"
val selectById = (id:Int) => selectAll.filter(_.id == id)
def all: Try[Option[Vector[T]]]
def get (id:Int): Try[Option[T]]
def add (obj: T): Try[Option[Int]]
def update (id:Int, obj:T): Try[Option[Int]]
def delete (id:Int):Try[Option[Int]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment