Class DialectFactory

java.lang.Object
org.alfresco.repo.domain.dialect.DialectFactory

public class DialectFactory extends Object
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
  • 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

      public static Dialect buildDialect(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.