Hibernate-具有排序顺序的多列索引 [英] Hibernate - Index on Multiple columns with sort order
本文介绍了Hibernate-具有排序顺序的多列索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码:
@Table(appliesTo = "MyTable", indexes = {
@Index(name = "MultipleColumnsIndex", columnNames = { "column1", "columns2" })})
注意:这是休眠表.
通过查看数据库中创建的表,我可以看到索引-两列顺序均为ASC.是否可以按ASC顺序对column1进行排序,按DESC顺序对column2进行排序?
From looking at the created table in Database I can see the index - both columns order is ASC. Is it possible to sort column1 by ASC order and column2 by DESC order ?
推荐答案
这是hibernate 5.2.10中的错误,并已在5.2.13中修复
This is bug in hibernate 5.2.10 and fixed in 5.2.13 HHH-11913
这篇关于Hibernate-具有排序顺序的多列索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文