看来您在错误地混合了Hibernate方言和数据库。在原始问题中,您有一个MySQL数据库和一种方言
org.hibernate.dialect.HSQLDialect(请参见下面的第一个代码块)。
在您的解决方案中,您拥有MySQL数据库和正确的方言
org.hibernate.dialect.MySQL5Dialect(请参见下面的第二个代码块)。
如果您
databasePlatform将原始语言中的更改为MySQL语言,那么它也可以正常工作。
原版的:
<bean id="entityManagerFactory" > ... <property name="jpaVendorAdapter"> <bean > ... <property name="databasePlatform" value="org.hibernate.dialect.HSQLDialect"/> </bean> </property> ...</bean>
工作方式:
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="WebAppPU" transaction-type="RESOURCE_LOCAL"> ... <properties> ... <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> ... </properties> </persistence-unit></persistence>



