Map query results to case classes