public static SearchFactoryImplementor getSearchFactoryBySessionImplementor(SessionImplementor session) {
return getSearchFactoryBySFI( session.getFactory() );
}
public static SearchFactoryImplementor getSearchFactoryBySFI(SessionFactoryImplementor sfi) {
final SearchFactoryReference factoryReference = sfi.getServiceRegistry()
.getService( SearchFactoryReference.class );
if ( factoryReference != null ) {
return factoryReference.getSearchFactory();
}
else {
throw LoggerFactory.make().searchFactoryReferenceServiceNotFound();
}
}