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

Add java.sql.Timestamp to allowed list to invoke methods similar to java.util.Date #974

Open
oleksiimiroshnyk opened this issue Aug 25, 2023 · 0 comments

Comments

@oleksiimiroshnyk
Copy link

  • Version of Thymeleaf (and any involved extensions) you are using.
    3.1.1

  • Environment: versions of Spring, Spring Boot, or any other
    relevant libraries.

spring boot 3.0.6
hibernate 6.2.6

  • Detailed steps to reproduce your issue.

So I have hibernate entity that has a date(java.util.Date) field
protected Date submitDate;

which in runtime seems to become java.sql.Timestamp(it extends java.util.Date)

and in my template I have
${order.submitDate.compareTo(someAnotherDate)>0}

And I got exception, calling method compareTo is forbidden for type class java.sql.Timestamp

While my tests are passing, but in my test I mock DB/hibernate layer and so my entity has java.util.Date not Timestamp.
So I think java.sql.Timestamp should be also added to allowed list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant