javahibernatejpaentitymanagernamed-query

JPA/Hibernate - No query defined for that name


I have looked at all the similiar posts but i just cannot figure it out. Any ideas ? Here is my Main:

enter image description here

The Entity itself:

enter image description here

and finally my persistence.xml which is located inside META-INF in document root.

enter image description here

Annotation processing is turned on inside IntelliJ Idea(Ultimate 2020.2)..

Finally my build.gradle:

enter image description here

When i start the application however i get this error:

enter image description here

There is 1 entry in my database which i inserted manually. It should print out this element. Any help is greatly appreciated :(


Solution

  • Put the NamedQuery annotation inside a NamedQueries annotation like so

    @NamedQueries({
        @NamedQuery(...)
    })
    

    This works for me.