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?

4 comments
Comment actions Permalink

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
Comment actions Permalink

@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
Comment actions Permalink

Thanks Konstantin,

Any plans to update the forum's text editor?

Cheers.

0
Comment actions Permalink

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

0

Please sign in to leave a comment.