Description
XWikiHibernateStore.injectCustomMappings(XWikiDocument, XWikiContext)
loops through every object attached to a document, gets the class of that object and calls injectCustomMapping on that class. Since xWikiObjects are grouped by class it is only necessary to get the first object of each class, get the class and call injectCustomMapping on that class.
This will make a major improvement for documents with thousands of objects of the same class and it is very easy to change.