When applying the following order by clause:
Expression<String> orderPath = lineRoot.get(OrderLine_.id).get(OrderLineId_.orderNumber);
lineQuery.orderBy(cb.desc(cb.substring(orderPath, cb.literal(2))));
Even when specifying both from and length parameters in the code the following error is thrown that:
Microsoft SQL Server 2008 fails to execute the SQL with error 174. The function substring requires 3 parameters.
|