【发布时间】:2012-02-07 11:34:11
【问题描述】:
我在使用 Grails 2.0 和 Postgresql 9.1 时遇到问题
我正在尝试使用顺序 ID 映射现有数据库。 但是,即使没有在域中创建任何类,我也会遇到错误:
Compiling 1 source files.....
| Running Grails application
| Error executing bootstraps:
Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
(...)
Invocation of init method failed; nested exception is org.hibernate.HibernateException:
Missing sequence or table: hibernate_sequence
我的数据源是:
dataSource {
pooled = true
driverClassName = "org.postgresql.Driver"
username = "postgres"
password = "postgrespass"
dialect = org.hibernate.dialect.PostgreSQLDialect
logSql = true
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = ""
url = "jdbc:postgresql://localhost:5432/Rambo"
}
}
}
Tee 现有数据库是一个扑克软件数据库(Holdem manager)。我正在研究一个不使用序列的 PlayerHand 对象,但 Player 对象有一个序列表。
奇怪的是,在之前的程序中,我可以很容易地使 Player 对象与 Postgresql 8.3 和 Grails 2.0 一起工作。
【问题讨论】:
标签: hibernate postgresql grails grails-orm