[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-390) Property pointed to by "mappedBy" not found if defined in superclass of class referenced by "targetType"

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Aug 25 18:38:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-390?page=comments#action_24100 ] 

Emmanuel Bernard commented on ANN-390:
--------------------------------------

What do you mean?
1. a superclass not mapped: this is expected
2. a superclass mapped as @MappedSuperclass: it seems to work for me
3. a superclass mapped as @Entity: I think this is not consistent, 
in your case, assuming the superclass is named TaskImpl and the class owning the oneToMany is DeploymentPlan,
you have a @ManyToOne DeploymentPlan getDeploymentPlan(); that comes from *any* task, not only DeploymentTasks
So what you are defining is not a bidirectional relationship but some sort of threesome

> Property pointed to by "mappedBy" not found if defined in superclass of class referenced by "targetType"
> --------------------------------------------------------------------------------------------------------
>
>          Key: ANN-390
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-390
>      Project: Hibernate Annotations
>         Type: Bug

>  Environment: Windows XP SP2, Eclipse 3.2 final, WTP 1.5 final
> HibernateTools-3.2.0.200607060659-nightly.zip with relevant jars in org.hibernate.eclipse_3.2.0.200607060659-nightly plugin replaced with same date jars built from SVN. Removed WTP plugins from Hibernate Tools dist since I already had them loaded.
> I realize that this does not exactly match the build drivers for the nightly I'm using, but I don't think this is the issue here.
>     Reporter: Adrian Sampaleanu

>
>
> When trying to open session factory in the Hibernate Console, I get:
> org.hibernate.AnnotationException: mappedBy reference an unknown property: com.tirawireless.jump.jdm.model.task.DeploymentTaskImpl.deploymentPlan in com.tirawireless.jump.jdm.model.plan.DeploymentPlanImpl.deploymentTasks
> 	at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:503)
> .....
> The relevant property and annotation is as follows:
>     @OneToMany(targetEntity = DeploymentTaskImpl.class, mappedBy = "deploymentPlan", fetch = FetchType.LAZY)
>     @OrderBy(clause = "name ASC")
>     @Cascade({CascadeType.SAVE_UPDATE})
>     public Set<DeploymentTask> getDeploymentTasks()
> The "deploymentPlan" property is _not_ defined in DeploymentTaskImpl, but is defined in it's superclass. I would think that it should be visible when establishing the mapping above.
> Have not found this issue addressed in either the forums or JIRA.

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