catch ( ClassNotFoundException e ) {
throw new SearchException( "Unable to load entity class from criteria: " + targetEntity, e );
}
}
}
QueryLoader loader = new QueryLoader();
loader.init( session, searchFactoryImplementor );
loader.setEntityType( classes[0] );
loader.setCriteria( criteria );
return loader;
}
else if ( classes.length == 1 ) {
final QueryLoader loader = new QueryLoader();
loader.init( session, searchFactoryImplementor );
loader.setEntityType( classes[0] );
return loader;
}
else {
final MultiClassesQueryLoader loader = new MultiClassesQueryLoader();
loader.init( session, searchFactoryImplementor );
loader.setEntityTypes( classes );
return loader;
}
}