日期:2014-05-16  浏览次数:20555 次

Hibernate 报错 Dialect does not support identity key generation

设置数据库方言不要写错

1.SQLSERVER

<property name="hibernateProperties">
??????????? <props>
??????????????? <!-- 设置Hibernate的数据库方言为SQLSERVER -->
??????????????? <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
??????????????? <!-- 设置Hibernate是否在控制台输出SQL语句,开发调试阶段通常设为true -->
??????????????? <prop key="hibernate.show_sql">true</prop>
??????????????? <prop key="hibernate.format_sql">true</prop>
??????????? </props>
??????? </property>

?

2.ORACLE

<!-- 设置Hibernate的相关属性 -->
??????? <property name="hibernateProperties">
??????????? <props>
??????????????? <!-- 设置Hibernate的数据库方言为Oracle9Dialect -->
??????????????? <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
??????????????? <!-- 设置Hibernate是否在控制台输出SQL语句,开发调试阶段通常设为true -->
??????????????? <prop key="hibernate.show_sql">true</prop>
??????????????? <prop key="hibernate.format_sql">true</prop>
??????????? </props>
??????? </property>

1 楼 abc3720 2012-06-15  
木有写错 还是报这个