Home > Software engineering >  Spring boot 3.0.1, I have 2 Strange errors in CreateQuery() function and @Autowire adnnotation
Spring boot 3.0.1, I have 2 Strange errors in CreateQuery() function and @Autowire adnnotation

Time:01-01

1

Hello everyone, i have this strange errors, the code is working , but the querryone is strange anyway and annoy. Thx hope there is a solution

I searched allmost everywhere for a solution, i didn't find anything helpfull

CodePudding user response:

Hibernate 6 expects implicit SELECT clause in front now, however the old query still compiles, it is recommended now to add SELECT as well.

SELECT e FROM Employee e

EntityManager autowiring error is most likely only because of IntelliJ cannot find the correct configuration for this bean, but should work fine at runtime.

CodePudding user response:

This error is coming from your IDE, or more precisely from some IDE plugin.

I don't know what plugin you're using, but I imagine that the plugin is validating that the query is syntactically correct JPQL, and is not accepting one of HQL's many extensions to the syntax of JPQL.

Your query is perfectly legal HQL, for the record.

  • Related