[hibernate-dev] Entity name in the context of JPA2 meta model (HHH-5709).
steve at hibernate.org
Wed Nov 3 12:49:54 EDT 2010
On Wednesday, November 03, 2010, at 11:33 am, Tomasz Blachowicz wrote:
> Steve, I think I know where you coming from. And my request is to do it
> *only* in the context of JPA meta-model. I'm far from making any changes to
> the internals of Hibernate.
> My pain point is that if EntityType is not providing me with the
> @Entity.name I don't have any other means of getting that piece of
> information through meta-model other than getting the entity class by name
> and checking @Entity in my code, which I'd consider pretty nasty hack.
> What's more FQN of entity class can be obtained not only by calling
> EntityType#getName, but also by calling EntityType#getJavaType (inherited
> from Type) or EntityType#getBindableJavaType (inherited form Bindable).
I already stated that I empathize with what you propose for these exact
reasons. I specifically said it was mainly because the JPA metamodel gives
you no other way to get this information. So not sure where the disagreement
I'm not talking about effects of these changes internally. Hibernate itself
never really uses this value in relation to the entity (it registers the
import, that's it). Again, my concern is users. If you are using and relying
on EntiytType.getName() to return the FQN you are screwed if you update to
whatever includes this change. At the very least the change should not come
during a minor release rev. Now, if people don't really use this then its not
such a big deal. Again outside my realm of experience, hence I ask...
Steve Ebersole <steve at hibernate.org>
More information about the hibernate-dev