Java 类org.hibernate.engine.jdbc.dialect.spi.DialectResolver 实例源码

项目:sqlite-dialect    文件:SQLiteMetadataBuilderInitializer.java   
@Override
public void contribute(MetadataBuilder metadataBuilder, StandardServiceRegistry serviceRegistry) {
    DialectResolver dialectResolver = serviceRegistry.getService(DialectResolver.class);

    if ((dialectResolver instanceof DialectResolverSet)) {
        ((DialectResolverSet) dialectResolver).addResolver(resolver);
    }
}
项目:sqlite-dialect    文件:SQLiteMetadataBuilderInitializerTest.java   
@Before
public void setup() {
    initializer = new SQLiteMetadataBuilderInitializer();

    metadataBuilder = mock(MetadataBuilder.class);
    registry = mock(StandardServiceRegistry.class);
    resolver = mock(DialectResolverSet.class);

    when(registry.getService(DialectResolver.class)).thenReturn(resolver);
}
项目:sqlite-dialect    文件:SQLiteMetadataBuilderInitializerTest.java   
@Override
public boolean matches(Object object) {
    DialectResolver actual = (DialectResolver) object;
    DialectResolutionInfo info = mock(DialectResolutionInfo.class);
    when(info.getDatabaseName()).thenReturn(databaseName);

    if ("SQLite".equals(databaseName)) {
        return actual.resolveDialect(info) instanceof SQLiteDialect;
    } else {
        return actual.resolveDialect(info) == null;
    }
}
项目:lams    文件:DialectResolverInitiator.java   
@Override
public DialectResolver initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    final DialectResolverSet resolver = new DialectResolverSet();

    applyCustomerResolvers( resolver, registry, configurationValues );
    resolver.addResolver(StandardDialectResolver.INSTANCE );

    return resolver;
}
项目:sdcct    文件:SdcctHsqlDialect.java   
@Override
@SuppressWarnings({ CompilerWarnings.RAWTYPES })
public SdcctHsqlDialectResolver initiateService(Map configValues, ServiceRegistryImplementor serviceRegistry) {
    serviceRegistry.locateServiceBinding(DialectResolver.class).setService(SdcctHsqlDialectResolver.INSTANCE);

    return SdcctHsqlDialectResolver.INSTANCE;
}
项目:lams    文件:DialectFactoryImpl.java   
@Override
public void injectServices(ServiceRegistryImplementor serviceRegistry) {
    this.strategySelector = serviceRegistry.getService( StrategySelector.class );
    this.dialectResolver = serviceRegistry.getService( DialectResolver.class );
}
项目:lams    文件:DialectResolverInitiator.java   
@Override
public Class<DialectResolver> getServiceInitiated() {
    return DialectResolver.class;
}
项目:lams    文件:DialectResolverSet.java   
public DialectResolverSet() {
    this( new ArrayList<DialectResolver>() );
}
项目:lams    文件:DialectResolverSet.java   
public DialectResolverSet(List<DialectResolver> resolvers) {
    this.resolvers = resolvers;
}
项目:lams    文件:DialectResolverSet.java   
public DialectResolverSet(DialectResolver... resolvers) {
    this( Arrays.asList( resolvers ) );
}
项目:lams    文件:CoreMessageLogger.java   
@LogMessage(level = WARN)
@Message(value = "Error executing resolver [%s] : %s", id = 316)
void unableToExecuteResolver(DialectResolver abstractDialectResolver,
                             String message);
项目:lams    文件:DialectFactoryImpl.java   
/**
 * Intended only for use from testing.
 *
 * @param dialectResolver The DialectResolver to use
 */
public void setDialectResolver(DialectResolver dialectResolver) {
    this.dialectResolver = dialectResolver;
}
项目:lams    文件:DialectResolverSet.java   
/**
 * Add a resolver at the end of the underlying resolver list.  The resolver added by this method is at lower
 * priority than any other existing resolvers.
 *
 * @param resolver The resolver to add.
 */
public void addResolver(DialectResolver resolver) {
    resolvers.add( resolver );
}
项目:lams    文件:DialectResolverSet.java   
/**
 * Add a resolver at the beginning of the underlying resolver list.  The resolver added by this method is at higher
 * priority than any other existing resolvers.
 *
 * @param resolver The resolver to add.
 */
public void addResolverAtFirst(DialectResolver resolver) {
    resolvers.add( 0, resolver );
}