Entity resultEntity = null;
DistinguishedName principalDN = getRelativeDN(internalId);
String relativeDN = principalDN.toCompactString();
String searchDNStr = searchDN.toCompactString();
if (relativeDN.equals(searchDNStr) || relativeDN.endsWith(searchDNStr)){
internalId = principalDN.toCompactString();
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());