Hi ,

After migrating spring boot from 2.7.8 to 3.1.0 version, I'm getting an error related to JPA.Validation failed for query for method public abstract org.springframework.data.domain.Page

com.example.repository.jpa.SampleRepository.getItems(org.springframework.data.domain.Pageable,java.lang.String,java.util.Date,java.util.Date)","logger_name":"org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext","thread_name":"main"}

Comment From: wilkinsona

In response to your blog post comment, @bclozel said:

Please create a StackOverflow question for this or a new Spring Boot issue if you manage to create a minimal sample application that reproduces the problem

Please provide the requested minimal sample application.

Comment From: charanrajctr

Sure. Thank you @wilkinsona

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Comment From: zhoushuai721

I also encountered same error when upgrading springboot from 2.7.x to 3.1.x

Comment From: wilkinsona

@zhoushuai721 if you can provide a minimal sample that reproduces the problem we can re-open this issue and take a look.

Comment From: zhoushuai721

@zhoushuai721 if you can provide a minimal sample that reproduces the problem we can re-open this issue and take a look.

@wilkinsona I would like to share but I cannot as it is company code.
one change we did related to query is from

@Id
@GeneratedValue
@Type(type = "org.hibernate.type.UUIDCharType")
private UUID id;

to

@Id
@GeneratedValue
@JdbcTypeCode(Types.CHAR)
private UUID id;           

Comment From: wilkinsona

We don't need your actual application. What we really want is a minimal example that focuses only on the problem that you're facing. An app created on https://start.spring.io is often a good starting point.

Comment From: MugeshKanagasabapathi

I too facing some issues when we upgrading springboot from 2.7.x to 3.2.x

Sample working query in 2.7.x

@Query(value = "SELECT ai FROM {entityName} ai WHERE "
    + "(:invoiceNumber IS NULL OR ai.invoiceNumber LIKE :invoiceNumber) AND "
    + "(cast(:invoiceDate as date) IS NULL OR ai.invoiceDate = :invoiceDate)" 
    )

Getting error in 3.2.x

nulliscast'
    at o.h.q.h.i.StandardHqlTranslator$1.syntaxError(StandardHqlTranslator.java:46)
    at o.a.v.r.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
    at o.a.v.runtime.Parser.notifyErrorListeners(Parser.java:543)
    at o.a.v.r.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
    at o.a.v.r.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
    at o.h.g.hql.HqlParser.queryExpression(HqlParser.java:1780)
    at o.h.g.hql.HqlParser.selectStatement(HqlParser.java:400)
    at o.h.g.hql.HqlParser.statement(Hql...

Comment From: scottfrederick

@MugeshKanagasabapathi As Andy stated above, we'll need a small sample application that reproduces the problem before we can do anything else with this issue.