注册 登录
编程论坛 Oracle论坛

[求助]关于hibernate配置问题

linpei23 发布于 2007-03-13 11:54, 2059 次点击

hibernate的配置是

<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">123456</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="connection.username">user</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class"></property>

运行程序时,会出现下面的错误:
Exception in thread "main" org.hibernate.MappingException: Dialect does not support identity key generation
at org.hibernate.dialect.Dialect.getIdentityColumnString(Dialect.java:392)
at org.hibernate.dialect.Dialect.getIdentityColumnString(Dialect.java:403)
at org.hibernate.mapping.Table.sqlCreateString(Table.java:259)
at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:669)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:65)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:49)
at Test.main(Test.java:20)

原因是什么?

1 回复
#2
lc12342010-06-10 21:25
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
好像是这行有问题,你再仔细看看
1