[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-5709) JPA Metamodel: EntityType.getName != @Entity.name

Steve Ebersole (JIRA) noreply at atlassian.com
Thu Nov 11 16:26:13 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-5709.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0.0.Alpha1
                   3.6.1

> JPA Metamodel: EntityType.getName != @Entity.name
> -------------------------------------------------
>
>                 Key: HHH-5709
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5709
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: metamodel
>    Affects Versions: 3.6.0
>            Reporter: Tomasz Blachowicz
>            Assignee: Steve Ebersole
>             Fix For: 3.6.1, 4.0.0.Alpha1
>
>
> 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.
> {quote}
> *10.1 Entity*
> The {{Entity}} annotation specifies that the class is an entity. This annotation is applied to the entity
> class.
> 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.
> {code:java} 
> @Documented @Target(TYPE) @Retention(RUNTIME)
> public @interface Entity {
> String name() default "";
> }
> {code}
> {quote}
> 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, HHH-2597 and HHH-4465.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list