Refactored BaseDAOImpl and it's inheritors.