| @Chris Cranford Thanks a lot for the clarification. I guess the first is used to name entities in HQL while the latter is for JPQL, am I correct? In my case, I'm dealing with a big number of entities in the form of HBM files. Many of them share the same unqualified class name. Indeed when I add the attribute entity-name to the HBM mapping and specify a unique name (I simply set it as the FQCN), the issue is indeed solved. Actually to be specific, based on what you just clarified, I guess the attribute entity-name is actually the Hibernate entity name, not the JPA entity name, but checking the source, it seems that in the class AbstractEntitySourceImpl, the JPA entity name is set the Hibernate entity name if specified in the HBM entity-name attribute. I actually had already tried adding entity-name before creating this JIRA issue and it did solve the problem with the exception. Still I was wondering if the fix of https://hibernate.atlassian.net/browse/HHH-13060 could have been done so that the exception gets thrown only when the SessionFactory is built, and not at the early stage of building the metadata sources. That would have avoided the changes I have to do (in my case, the code is not building a SessionFactory, only getting PersistentClass objects). Now that 5.4.0 is GA, I think I'm going to anyway set the entity-name attribute to the FQCN wherever needed (I figured out a way to automatically do it), so I'm fine with closing this issue at this point. |