Search code examples
javahibernatenamed-query

In Java, are @NamedQueries that are changed available right away, or is there a caching issue in Hibernate?


In Java, are @NamedQueries that are changed available right away, or is there a caching issue in Hibernate?

@NamedQueries( {
    @NamedQuery(name = etc..

I made changes to 2 @NamedQuery but they are not doing what they should.

Does Hibernate need to be restarted?

Cache cleared somewhere?

Just takes time and they will show up?

What exactly is the procedure when changing @NamedQueries?

Thank you so much!


Solution

  • You can't change a named query. They're part of the source code of the class. If you change them in your source file, you need to recompile the source file and restart the application.