Package org.alfresco.repo.domain.dialect
Class DialectFactory
- java.lang.Object
-
- org.alfresco.repo.domain.dialect.DialectFactory
-
public class DialectFactory extends java.lang.ObjectA 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 Classes Modifier and Type Class Description static interfaceDialectFactory.DatabaseDialectMapperFor a given database product name, instances of DatabaseDialectMapper know which Dialect to use for different versions.static classDialectFactory.VersionInsensitiveMapperA simple DatabaseDialectMapper for dialects which are independent of the underlying database product version.
-
Constructor Summary
Constructors Constructor Description DialectFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DialectbuildDialect(java.lang.String dialectName)Returns a dialect instance given the name of the class to use.static DialectbuildDialect(java.lang.String databaseName, int databaseMajorVersion, java.lang.String driverName)Builds an appropriate Dialect instance.
-
-
-
Method Detail
-
buildDialect
public static Dialect buildDialect(java.lang.String databaseName, int databaseMajorVersion, java.lang.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
public static Dialect buildDialect(java.lang.String dialectName)
Returns a dialect instance given the name of the class to use.- Parameters:
dialectName- The name of the dialect class.- Returns:
- The dialect instance.
-
-