I have a test case that tests all the DAOs in my project. It uses openpojo to get the list of all DAO classes. The test case then iterates over the list of DAO classes and invokes all methods in them using reflection. This worked fine till I upgraded from hibernate 5.6.5 to hibernate 6.6.23. Now one of the DAO fails as it tries to execute an HQL query. It seems it cannot find the entity in the HQL.
org.hibernate.query.sqm.UnknownEntityException: Could not resolve entity class
That entity is in a different module and I think the error makes sense because during hibernate configuration in the test case, it finds 3 hibernate configuration files (one from the same module, 2 others coming from dependencies) in the classpath and loads the entities defined in them. Since that entity's configuration file is in a different module, it will not be available in the classpath.
So, the error seems to make sense but question is how was it working before with hibernate 5.6.5?