Revert "Removed unused methods as GenericDAO.getLastId() no longer (need to) exist."

This reverts commit 9cb5c840876e4f6be2aa7649dd252a70f6e03da7.
Reinstated GenericDAO.getLastId(). Apparently GDMS (shouldn't but) uses it quite heavily.