SQL to Class