Search code examples
javasql-serverspring-bootjooqdsl

DSL query sortBy in case insensitive query formation in java, mssql DB


Current response a-z A-Z Needed as aA-zZ or Aa-Zz

Code line : return select -> select.orderBy(sortFields); Note : where sortFields is List<OrderField> sortFields = new ArrayList>()

tried using DSL.lower menthod but it saying to convert sortFields as string. Code line : return select -> select.orderBy(lower(sortFields));

sortFields is in the reference of List<OrderField<?>> is there any way to get sorting as case insensitive to get response as (aA-zZ or Aa-Zz)


Solution

  • Finally found the answer for this by adding Field orderFieldSort = lower((Field) orderField);