[hibernate-issues] [Hibernate-JIRA] Updated: (ANN-425) @ManyToOne defined as @Id in a @MappedSuperclass/@EmbeddableSuperclass can't be reached by an @OneToMany(mappedBy)

Giampaolo Tomassoni (JIRA) noreply at atlassian.com
Mon Aug 28 16:45:24 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-425?page=all ]

Giampaolo Tomassoni updated ANN-425:
------------------------------------

    Attachment: test01b.zip

"What is the original Bug report number? I don't recall any such request apart from ANN-381 which is slightly different and fixed already "

It was not a bug report: it was in the user forum. I don't remember when I posted it, but there where replies from hibernate community.

Anyway, I'm attaching a testcase in which a ABPK class is available. Now the configuration phase reports:

org.hibernate.AnnotationException: biz.tomassoni.hibernate.test01.ABPK has no persistent id property

Please note that ejb-3.0 specs says "A primary key class must be defined to represent a composite primary key" (2.1.4). But in cases like the one I'm reporting, a PK class would never be used by the application developer: I'm never going to load an AB instance by its primary key, but instead through the OneToMany fields in A or B, or pheraps by executing a query. So, where's the need for the "must" word in the ejb-3.0 phrase? In Hibernate there is no need for a PK class unless you want to load an instance, so I guess that the Hibernate team should relax this aspect of the Ejb-3.0 specs.

> @ManyToOne defined as @Id in a @MappedSuperclass/@EmbeddableSuperclass can't be reached by an @OneToMany(mappedBy)
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: ANN-425
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-425
>      Project: Hibernate Annotations
>         Type: Bug

>     Versions: 3.1beta3, 3.1beta4, 3.1beta5, 3.1beta6, 3.1beta7, 3.1beta8, 3.1beta9, 3.1.0.Beta10, 3.2.0.cr1
>  Environment: hibernate-3.2.CR2 + hibernate-annotations-3.2.0-CR1 + hibernate-entitymanager-3.2.0-CR1 under JBoss 4.0.4-GA and EJB3
>     Reporter: Giampaolo Tomassoni
>  Attachments: test01.zip, test01b.zip
>
>
> The case in subject reports the following error:
> org.hibernate.AnnotationException: mappedBy reference an unknown property: biz.tomassoni.hibernate.test01.AB.a in biz.tomassoni.hibernate.test01.A.a
> It is months now that this problem had been reported (by me and by other), but no progress.
> I'm attaching a testcase in the hope it can be useful.

-- 
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