[hibernate-issues] [Hibernate-JIRA] Resolved: (METAGEN-81) @Embeddable entities don't inherit the access type if it comes from the hierarchy of the containing class

Hardy Ferentschik (JIRA) noreply at atlassian.com
Mon Mar 12 07:50:48 EDT 2012


     [ https://hibernate.onjira.com/browse/METAGEN-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hardy Ferentschik resolved METAGEN-81.
--------------------------------------

    Resolution: Fixed

> @Embeddable entities don't inherit the access type if it comes from the hierarchy of the containing class
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: METAGEN-81
>                 URL: https://hibernate.onjira.com/browse/METAGEN-81
>             Project: Hibernate Metamodel Generator
>          Issue Type: Bug
>          Components: processor
>    Affects Versions: 1.1.1.Final, 1.2.0.Final
>         Environment: Hibernate 4.1.1, PostgreSQL 9.1
>            Reporter: Guillaume Smet
>            Assignee: Hardy Ferentschik
>             Fix For: 1.x
>
>
> This is a followup from my post on the mailing list: we have @OneToOne relations on an @Embeddable object and they aren't present in the metamodel class generated for the @Embedded object.
> After a couple of hours of debugging/digging, I came to the conclusion that this is due to a missing updateEmbeddableAccessType() call in TypeUtils.determineAccessTypeForHierarchy(): if the containing class doesn't contain any information for the access type, the hierarchy of the containing class is scanned for access type information. Due to this missing call, in this specific case, the access type is not propagated to the @Embeddable entity via the @Embedded link. If by any chance, your @OneToOne annotations are on the methods in your @Embeddable entities, they are taken into account as it's the default access type. If they are positioned on the fields, they are ignored even if your @Id annotation is positioned on a field in the hierarchy.
> Pull request with a test case and the patch to follow.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list