Fixed persistence context bug while handling derived beans - now the bas...

...e class is always used to cache the derived instances