JPA (Hibernate) false error for functions such as YEAR and MONTH

Answered

This JPA query is valid when using Hibernate as the provider:

@Query("SELECT foo FROM Foo foo WHERE YEAR(foo.date) IN ?1")

But in a Spring Boot project, IDEA falsely marks it as an error with this message:

    Error:(37, 102) <expression>, <operator>, GROUP, HAVING or ORDER expected, got '('

Is this a bug in IDEA or do I have to do something special to enable it?

0
5 comments

Also update the text editor of the forums. It is barely usable.

Replace it with a sophisticated Markdown editor (https://github.com/showdownjs/showdown) and/or a decent WYSIWYG editor (e.g. https://www.froala.com/wysiwyg-editor).

0

@Behrang,

Here is a related bug on YouTrack:

https://youtrack.jetbrains.com/issue/IDEA-208486

Feel free to comment inside and watch the item in order to be notified once it has updates. See this article if you are not familiar with YouTrack.

0

Thanks Konstantin,

Any plans to update the forum's text editor?

Cheers.

0

Unfortunately, we have no control over this forum engine, as it's a third-party hosted solution.

0

Here, another similar issue on YouTrack (this one with coalesce): https://youtrack.jetbrains.com/issue/DBE-14023

0

Please sign in to leave a comment.