433/hibernate-core-osgi — comment on commit 86520363f09b109e0bd9f58a9fe288ae65f6501c
File:  line 0
By 433:

It's related to this issue: https://hibernate.onjira.com/browse/HHH-5962

This new classloader combines two classloaders - one of persistentClass and one of this.getClass(). They are NOT the same if the system runs in OSGi mode, where hibernate core is located in one bundle (with it's own classloader) and the persistent classes are located in other bundles (with their own classloaders). So this classloader makes possible to load all org.hibernate.* and javassist.* classes using hibernate bundle's own platformClassLoader and load persistent classes using their bundle's classloaders.

Probably there is a reason to check if this is really needed and the classloaders are not equal, i.e.
```
if (!persistentClass.getClassLoader().equals(getClass().getClassLoader()) {
// use complex classloader
}```