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 Summary
Constructors -
Method Summary
Modifier 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
-
DataSourceBackedDialectFactory
Deprecated.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 interfaceDialectFactory- Parameters:
settings- aMapcontaining the settings returned by an invocation of theStandardServiceRegistryBuilder.getSettings()method; must not benulldialectResolutionInfoSource- aDialectResolutionInfoSourcesupplied by Hibernate; may be, and often is,null- Returns:
- a
Dialect; nevernull - Throws:
NullPointerException- ifsettingsisnullHibernateException- if aDialectcould not be constructed- See Also:
-
contribute
Deprecated.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 eithernullor a blankStringsettings.get(JAKARTA_JTA_DATASOURCE)returns a non-nullDataSource
If any other state of affairs holds, this method takes no action.
- Specified by:
contributein interfaceServiceContributor- Parameters:
standardServiceRegistryBuilder- aStandardServiceRegistryBuilderwhoseStandardServiceRegistryBuilder.addInitiator(StandardServiceInitiator)may be called withthisas its sole argument; must not benull
-
getServiceInitiated
Deprecated.For Hibernate use only.ReturnsClass<DialectFactory>when invoked, thus describing the type of service theinitiateService(Map, ServiceRegistryImplementor)will initiate.- Specified by:
getServiceInitiatedin interfaceServiceInitiator<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 interfaceStandardServiceInitiator<DialectFactory>- Parameters:
settings- ignoredserviceRegistry- aServiceRegistryImplementorsupplied by Hibernate- Returns:
thiswhen invoked
-
ServiceLoaderinstances only.