Hibernate使用新索引更新数据库结构 [英] Hibernate updating database structure with new indexes

查看:181
本文介绍了Hibernate使用新索引更新数据库结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

众所周知,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.

更新:
我不同意 Stefan Steinegger 。使用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使用新索引更新数据库结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆