refactoring beans vol.3, sql query for four tables