0

I want to cast column from string to long to use the cb.between() functionality.

cb.between(number.as(Long.class), Long.valueOf(startNumber), Long.valueOf(endNumber));

number is Path<String>

Getting an exception as expecting CLOSE, found '(' near line 1, column 967...[query] At char 967 of the query, its '(' in numeric(19,0) within query, it is not forming query using bigint, instead numeric.

In junit its working properly where in query bigint is generated in it.

I have also gone through below, please let me know how to solve the problem.

Using JPA 2.0 Criteria API and cast causes generated JPQL to fail in Hibernate

Best Regards, Soheb Shaikh

Community
  • 1
  • 1
user3819259
  • 95
  • 1
  • 9

1 Answers1

0

I solved it by creating a set of numbers having all numbers from Start to end number and then used in.

So no need to use between operator.

Best Regards, Soheb Shaikh

user3819259
  • 95
  • 1
  • 9