adding ResultSetWrapper to perform operations on result set and using inheritance for building select queries for dependent and independent tables