Select Query using case class attributes and id