在许多文档中我发现我们必须定义方言hibernate.cfg.xml
来告诉hibernate我们将使用什么语言或hibernate。在这个基础上hibernate会生成相应的sql。
<property name="hibernate.conection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dilect">org.hibernate.dialect.MySQLDilect</property>
更重要的是,任何数据库提供程序都可能有多个驱动程序,并且对于任何驱动程序,根据其版本可能有多种方言。
我的观点是,即使我们已经在那里提到了驱动程序(唯一),而且我们是单一版本的 jar,那么为什么这不仅足以生成 sql。