I was working recently on the implementation that uses JPA2 meta-model. It was rather surprise to me when I found out that name of the entity on EntityType is different than name of the entity specified with @Entity annotation.
The specification is not explicit about the entity names, so it could be interpreted differently, but I think it is reasonable to implicitly assume that entity name specified with @Entity is used as entity name with JPA2 meta-model.
The Entity annotation specifies that the class is an entity. This annotation is applied to the entity
The name annotation element specifies the entity name. If the name element is not specified, the entity
name defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries.
I know that in Hibernate the entity name if FQN of persistent class and the abbreviated name (without the package) can be only used within the HQL queries. I guess this was OK prior JPA2 when there was no such think like meta-model.
This topic has been already discussed several times, but I couldn't find any discussion in the context of JPA meta-model, thus I've decided to create a new ticket. The other issues related to this topic are: HHH-4375, and HHH-4465.