darrachequesne / spring-data-jpa-datatables

Spring Data JPA extension to work with the great jQuery plugin DataTables (https://datatables.net/)
Apache License 2.0
440 stars 174 forks source link

With first empty column causes exception on ordering IndexOutOfBoundsException #116

Closed jankod closed 4 years ago

jankod commented 4 years ago

When I add two empty column to the beginning of the table then ordering of the last two column causes error: "java.lang.IndexOutOfBoundsException: Index: 8, Size: 8".

Query request have first two column data empty: column[0].data and column[1].data .

In class org.springframework.data.jpa.datatables.AbstractPredicateBuilder.createPageable() line 57 I found exception IndexOutOfBoundsException.

My table has 10 columns. First two are empty. When I order by 8 column I see that was created SQL query with "order by" on the 10 column.

image

image

jankod commented 4 years ago

I have error in my code, I forgot to put orderable: false in JS code.