protected DialectFactory createDialectFactory ( ) { DialectFactoryImpl factory = new DialectFactoryImpl ( ) ; factory . injectServices ( new ServiceRegistryImplementor ( ) { @ Override public < R extends Service > R getService ( Class < R > serviceRole ) { if ( serviceRole == DialectResolver . class ) { return ( R ) new StandardDialectResolver ( ) ; } else if ( serviceRole == StrategySelector . class ) { return ( R ) new StrategySelectorImpl ( new ClassLoaderServiceImpl ( Thread . currentThread ( ) . getContextClassLoader ( ) ) ) ; } return null ; } @ Override public < R extends Service > ServiceBinding < R > locateServiceBinding ( Class < R > serviceRole ) { return null ; } @ Override public void destroy ( ) { } @ Override public void registerChild ( ServiceRegistryImplementor child ) { } @ Override public void deRegisterChild ( ServiceRegistryImplementor child ) { } @ Override public ServiceRegistry getParentServiceRegistry ( ) { return null ; } } ) ; return factory ; }
should be using the ServiceRegistry but getting it from the SessionFactory at startup fails in Spring