Class DataSourceBackedDialectFactory
java.lang.Object
io.helidon.integrations.cdi.hibernate.DataSourceBackedDialectFactory
- All Implemented Interfaces:
- Serializable,- StandardServiceInitiator<DialectFactory>,- DialectFactory,- Service,- ServiceContributor,- ServiceInitiator<DialectFactory>
public final class DataSourceBackedDialectFactory
extends Object
implements DialectFactory, ServiceContributor, StandardServiceInitiator<DialectFactory>
A 
DialectFactory implementation (and a ServiceContributor, and a StandardServiceInitiator<DialectFactory>) that introspects DatabaseMetaData from a configured DataSource.
 Hibernate is guaranteed to perform each of the following invocations, once, ever, in order:
- (The zero-argument constructor)
- The contribute(StandardServiceRegistryBuilder)method
- The initiateService(Map, ServiceRegistryImplementor)method (if applicable)
Then, at application runtime, after the sole instance of this class has been installed following the protocol
 above, Hibernate will call the buildDialect(Map, DialectResolutionInfoSource) method as appropriate.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuildDialect(Map<String, Object> settings, DialectResolutionInfoSource dialectResolutionInfoSource) Deprecated.For Hibernate use only.voidcontribute(StandardServiceRegistryBuilder standardServiceRegistryBuilder) Deprecated.For Hibernate use only.Deprecated.For Hibernate use only.initiateService(Map<String, Object> settings, ServiceRegistryImplementor serviceRegistry) Deprecated.For Hibernate use only.
- 
Constructor Details- 
DataSourceBackedDialectFactoryDeprecated.For use byServiceLoaderinstances only.Creates a newDataSourceBackedDialectFactory.
 
- 
- 
Method Details- 
buildDialect@Deprecated public Dialect buildDialect(Map<String, Object> settings, DialectResolutionInfoSource dialectResolutionInfoSource) Deprecated.For Hibernate use only.Retrieves theDataSourcestored in the suppliedMapunder theJdbcSettings.JAKARTA_JTA_DATASOURCEkey, and uses it to ultimately acquire aDatabaseMetaDatainstance to adapt into aDialectResolutionInfoinstance, such that aDialectResolutionInfoSourcecan be constructed, in the case where the supplieddialectResolutionInfoSourceisnull, and passes the resultingDialectResolutionInfoSourceto the standardDialectFactorythat Hibernate uses by default, such that Hibernate can determine whatDialectto use when database connectivity is established via aMETA-INF/persistence.xml'sjta-data-sourceelement.- Specified by:
- buildDialectin interface- DialectFactory
- Parameters:
- settings- a- Mapcontaining the settings returned by an invocation of the- StandardServiceRegistryBuilder.getSettings()method; must not be- null
- dialectResolutionInfoSource- a- DialectResolutionInfoSourcesupplied by Hibernate; may be, and often is,- null
- Returns:
- a Dialect; nevernull
- Throws:
- NullPointerException- if- settingsis- null
- HibernateException- if a- Dialectcould not be constructed
- See Also:
 
- 
contributeDeprecated.For Hibernate use only.Contributes thisDataSourceBackedDialectFactoryas aStandardServiceInitiator<DialectFactory>if and only if certain requirements are met.This method will call standardServiceRegistryBuilder.addInitiator(this)if and only if all of the following preconditions hold:- settings.get(- DIALECT- )returns an object that is either- nullor a blank- String
- settings.get(- JAKARTA_JTA_DATASOURCE- )returns a non-- null- DataSource
 If any other state of affairs holds, this method takes no action. - Specified by:
- contributein interface- ServiceContributor
- Parameters:
- standardServiceRegistryBuilder- a- StandardServiceRegistryBuilderwhose- StandardServiceRegistryBuilder.addInitiator(StandardServiceInitiator)may be called with- thisas its sole argument; must not be- null
 
- 
getServiceInitiatedDeprecated.For Hibernate use only.ReturnsClass<DialectFactory>when invoked, thus describing the type of service theinitiateService(Map, ServiceRegistryImplementor)will initiate.- Specified by:
- getServiceInitiatedin interface- ServiceInitiator<DialectFactory>
- Returns:
- Class<DialectFactory>when invoked
- See Also:
 
- 
initiateService@Deprecated public DataSourceBackedDialectFactory initiateService(Map<String, Object> settings, ServiceRegistryImplementor serviceRegistry) Deprecated.For Hibernate use only.Returnsthiswhen invoked.- Specified by:
- initiateServicein interface- StandardServiceInitiator<DialectFactory>
- Parameters:
- settings- ignored
- serviceRegistry- a- ServiceRegistryImplementorsupplied by Hibernate
- Returns:
- thiswhen invoked
 
 
- 
ServiceLoaderinstances only.