package models
import org.squeryl.KeyedEntity
import org.squeryl.dsl._
import org.squeryl.PrimitiveTypeMode._
case class User(var name: String, var email:String) extends KeyedEntity[Long]{
  val id:Long = 0
  
  lazy val projects = PartsListDb.projectMembers.right(this)
  def projectMembers(pId: Long):ProjectMembers = PartsListDb.projectMembers.where(pm => pm.userId === this.id and pm.projectId === pId).head

}