So, I've faced a nasty issue related to a multimodal project and spring-boot
The issue is described here: url to stackoverflow
And, so
I have a multimodal project module A has Hibernate entity classes and Spring components and
a project B is a spring boot project
to let spring boot project to recognize entity classes I use the annotation
@EntityScan(basePackageClasses = {MyEntityClassFromDependantProjectA.class})
All is good and fine till I use entityManager to execute a query and I get
Hibernate Pure native scalar queries are not yet supported
However, there is no issue if I use put my entity classes to spring boot project.
While debugging code I found that when I use @EntityScan annotation
Hibernate is then executing code involving
org.hibernate.annotations.NamedNativeQuery.class
even then I don't use this annotation, my project has only
javax.persistence.NamedNativeQuery
And when entities are in the same project as a spring-boot project
Hibernate is execute the code block related to
javax.persistence.NamedNativeQuery
Comment From: piroMe
Sorry, that is not a bug, I just mixed two annotations
org.hibernate.annotations.NamedNativeQuery and javax.persistence.NamedNativeQuery
removing org.hibernate.annotations.NamedNativeQuery solved the issue