Package org.alfresco.repo.domain.dialect
Class DialectFactory
java.lang.Object
org.alfresco.repo.domain.dialect.DialectFactory
A factory for generating Dialect instances.
This class is an Alfresco-specific version of the Hibernate class with the same name.
- Since:
- 6.0
- Author:
- Steve Ebersole, Alfresco
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFor a given database product name, instances of DatabaseDialectMapper know which Dialect to use for different versions.static classA simple DatabaseDialectMapper for dialects which are independent of the underlying database product version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DialectbuildDialect(String dialectName) Returns a dialect instance given the name of the class to use.static DialectbuildDialect(String databaseName, int databaseMajorVersion, String driverName) Builds an appropriate Dialect instance.
-
Constructor Details
-
DialectFactory
public DialectFactory()
-
-
Method Details
-
buildDialect
public static Dialect buildDialect(String databaseName, int databaseMajorVersion, String driverName) Builds an appropriate Dialect instance. The JDBC driver, the database name and version (obtained from connection metadata) are used to make the determination. An exception is thrown if a dialect was not explicitly set and the database name is not known.- Parameters:
databaseName- The name of the database product (obtained from metadata).databaseMajorVersion- The major version of the database product (obtained from metadata).driverName- THe name of the JDBC driver- Returns:
- The appropriate dialect.
-
buildDialect
Returns a dialect instance given the name of the class to use.- Parameters:
dialectName- The name of the dialect class.- Returns:
- The dialect instance.
-