john Smith
john Smith

Reputation: 1605

Hibernate - Index on Multiple columns with sort order

I have the following code :

@Table(appliesTo = "MyTable", indexes = {
  @Index(name = "MultipleColumnsIndex", columnNames = { "column1", "columns2" })})

Note : it's Hibernate Table.

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 ?

Upvotes: 3

Views: 1439

Answers (2)

This is bug in hibernate 5.2.10 and fixed in 5.2.13 HHH-11913

Upvotes: 1

It worked in hibernate 4.3.8.Final

@Table(appliesTo = "MyTable",indexes= {
     @Index(name = "MultipleColumnsIndex", columnNames = { "column1", "columns2 desc" })
})

But it's not working in hibernate 5.2.10.Final

Upvotes: 0

Related Questions