Skip to content

org.hibernate.jpa.TypedParameterValue cannot be cast to class java.util.Date #2695

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

Closed
edudar opened this issue Nov 10, 2022 · 3 comments
Closed
Labels
type: regression A regression from a previous release

Comments

@edudar
Copy link
Contributor

edudar commented Nov 10, 2022

There are a few related issues: #2548, #2570, etc.

It does not seem to work with nullable temporal parameters either. QueryParameterSetter casts value to Date explicitly. The actual type is TypedParameterValue since 2.7, though. This causes a standard class case exception like

java.lang.ClassCastException: class org.hibernate.jpa.TypedParameterValue cannot be cast to class java.util.Date
	at org.springframework.data.jpa.repository.query.QueryParameterSetter$NamedOrIndexedQueryParameterSetter.lambda$setParameter$1(QueryParameterSetter.java:98)
	at org.springframework.data.jpa.repository.query.QueryParameterSetter$ErrorHandling$1.execute(QueryParameterSetter.java:140)
	at org.springframework.data.jpa.repository.query.QueryParameterSetter$NamedOrIndexedQueryParameterSetter.setParameter(QueryParameterSetter.java:98)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 10, 2022
@schauder schauder added the type: regression A regression from a previous release label Nov 14, 2022
@schauder
Copy link
Contributor

Could you try this with a recent snapshot, to make sure it is still a problem?

@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 14, 2022
@spring-projects-issues
Copy link

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.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Nov 21, 2022
@spring-projects-issues
Copy link

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.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants