It seems like the fix is the same: in both cases, the while loop terminates when it encounters a MapperSuperclass. Only I put both conditions in the while clause and in