public static Dialect buildDialect(Properties props,
String databaseName,
int databaseMajorVersion) throws HibernateException {
String dialectName = props.getProperty( Environment.DIALECT );
if ( dialectName == null ) {
return determineDialect( databaseName, databaseMajorVersion );
}
else {
return buildDialect( dialectName );
}
}
Builds an appropriate Dialect instance.
If a dialect is explicitly named in the incoming properties, it is used. Otherwise, the database name and version
(obtained from connection metadata) are used to make the dertemination.
An exception is thrown if a dialect was not explicitly set and the database name is not known. |