Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot JPA Postgres substring with pattern matching #33631

Closed
miriyalajanardhan opened this issue Dec 24, 2022 · 1 comment
Closed

Spring Boot JPA Postgres substring with pattern matching #33631

miriyalajanardhan opened this issue Dec 24, 2022 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@miriyalajanardhan
Copy link

Native query of postgres to extract based on pattern works fine.

select to_number(substring('12.123','^\d+'),'FM9G999D99S')

Same used to work as JPA query (not as native query) in Spring boot 2.7 but not working with Spring boot 3.

Spring boot 2.7 dialect used: org.hibernate.dialect.PostgreSQL10Dialect

Spring boot 3 dialect used: org.hibernate.dialect.PostgreSQLDialect

Getting below error.

org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.QueryException: Parameter 2 of function substr() has type INTEGER, but argument is of type java.lang.String
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 24, 2022
@wilkinsona
Copy link
Member

I suspect that this is due to the upgrade to Hibernate 6.1. As such, it is out of Spring Boot's control. If you believe the problem is specific to how Spring Boot has configured Hibernate, please provide a minimal sample that reproduces the problem and we can investigate.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants