问题描述
众所周知,hibernate以非常奇怪的方式处理索引。只有从头开始创建数据库模式时,它才会生成它们。但是如果你试图更新数据库模式,hibernate将忽略新的索引。
It's well known fact that hibernate work with indexes in a very strange way. It generate them only if you create a database schema from the scratch. But if you try to update the database schema hibernate will ignore new indexes.
我的问题是,有没有人找到一个解决方案如何在模式期间要求hibernate为新索引生成SQL更新。
My question is, does anybody find a solution how to ask hibernate generate SQL for new indexes during schema update.
更新:
我不同意。使用hibernate进行索引管理很痛苦。很高兴看到该功能被安排在下一个版本(3.5.x),并且将向后兼容3.3.x和3.2.x.详情请访问。
UPDATE:I'll disagree with Stefan Steinegger. Index management with hibernate it's a pain. Nice to see that the feature was scheduled for next release (3.5.x) and will be backward compatible to 3.3.x and 3.2.x as well. Details are here.
推荐答案
Hibernate 3.5.0-Beta-2版本解决了这个问题。详情请访问和。
The issue resolved in Hibernate 3.5.0-Beta-2 release. Details are here and here.
这篇关于Hibernate使用新索引更新数据库结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!