[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5191) CollectionMetadataGenerator fails to obtain mappedBy attribute when is defined on superclasses

HG (JIRA) noreply at atlassian.com
Thu Jan 26 11:23:11 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45263#comment-45263 ] 

HG commented on HHH-5191:
-------------------------

Hello Adam,
 
I get the similar error ,
 
Caused by: org.hibernate.MappingException: @AuditMappedBy points to a property that doesn't exist: x.y.EnityClass.auditMappedByProperty
 
but at a different point.
 
ClassesAuditingData.forcePropertyInsertable(ClassesAuditingData.java:83)
ClassesAuditingData.updateCalculatedFields() line: 69
EntitiesConfigurator.configure(Configuration, ReflectionManager, GlobalConfiguration, AuditEntitiesConfiguration, Document, Element) line: 84
AuditConfiguration.<init>(Configuration) line: 86
AuditConfiguration.getFor(Configuration) line: 99
CustomAuditEventListener(AuditEventListener).initialize(Configuration) line: 335
EventListeners$1.processListener(Object) line: 198
EventListeners.processListeners(EventListeners$ListenerProcesser) line: 181
EventListeners.initializeListeners(Configuration) line: 194
AnnotationConfiguration(Configuration).getInitializedEventListeners() line: 1396
AnnotationConfiguration(Configuration).buildSessionFactory() line: 1385
AnnotationConfiguration.buildSessionFactory() line: 954
Ejb3Configuration.buildEntityManagerFactory() line: 892
HibernatePersistence.createContainerEntityManagerFactory(PersistenceUnitInfo, Map) line: 74
 
I am using hibernate 3.5.6.
 
To me it doesnt explains, how could you, not get this error, but the error which Hernan reported.
This could only happen, if it was introduced in the later builds of 3.5.2 (where HHH-5191 is fixed), and Hernan still uses 3.5.2 and not the later builds where it is was introduced.
 
The reason I say this is because, If You see the Call Hierarchy of CollectionMetaDataGenerator.getMappedBy, it would collide on EntitiesConfigurator.configure at line number 100.
Whereas the error I get occurs much before in EntitiesConfigurator.configure at line number 84.
 
As a workaround, I could still not use auditmappedby annotation, and live with the assosiation table.
 
But, Please help provide a solution.
 
Thanks,

PS : I just Attached the Modifed ClassesAuditingData.java file. This helps solve the problem I mentioned. Could this be accepted as a patch in 3.5.6 ?. Please let me know, the feedback on the patch.

> CollectionMetadataGenerator fails to obtain mappedBy attribute when is defined on superclasses
> ----------------------------------------------------------------------------------------------
>
>                 Key: HHH-5191
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5191
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: envers
>    Affects Versions: 3.5.1
>         Environment: Hibernate-envers build from branch_3_5 (3.5.2-SNAPSHOT)
>            Reporter: Hernán Chanfreau
>            Assignee: Adam Warski
>             Fix For: 3.5.3, 3.6.0.Beta1
>
>         Attachments: mappedByOnSuperclassProposalPatch.txt, mappedByOnSuperclassTestPatch.txt
>
>
> When the inverse side on a bidirectional relation is defined on a superclass, envers fails to configure the mappedBy attribute because it doesn't search on superclasses.
> Here is the original discussion: http://community.jboss.org/thread/151240?tstart=0
> I'm attaching two patcher. One contains 2 test cases and another with some modifications for this.
> Regards. Hernán.

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