}
catch (ClassLoadingException e) {
throw new SearchException( "Unable to load entity class from criteria: " + targetEntity, e );
}
finally {
serviceManager.releaseService( ClassLoaderService.class );
}
}
else {
if ( !entityType.getName().equals( targetEntity ) ) {
throw new SearchException( "Criteria query entity should match query entity" );