HHH-5920: Improved performance of PersistentClass