Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCustom MetadataSource and Dynamic Weaving
https://www.eclipse.org/forums/index.php/mv/msg/283184/788282/#msg_788282
wiki.eclipse.org/EclipseLink/Examples/JPA/MetadataSource
However, I also need weaving to take place dynamically, so I have specified -javaagent:eclipselink.jar as a JVM argument.
What I find is this: If my eclipselink-orm.xml is returned dynamically via a custom MetadataSource implementation, no weaving takes place. I get a message like this, instead:
Quote:
> Reverting the lazy setting on the OneToOne or ManyToOne attribute (createdBy) for the entity class (class com.rivermine.or.jpa.eclipselink.UserGroup) since weaving was not enabled or did not occur.
Yet if I take the exact same XML produced by my custom MetadataSource, and paste it into a real eclipselink-orm.xml file within META-INF, then the weaving does take place.
I can provide a complete test harness to demonstrate but thought I would just ask, first. Can anyone confirm or deny whether dynamic weaving is compatible with custom MetadataSources or what it is I need to do to get dynamic weaving enabled when using a custom MetadataSource? Thanks in advance.]]>Mike Gorman2012-02-01T15:47:34-00:00Re: Custom MetadataSource and Dynamic Weaving
https://www.eclipse.org/forums/index.php/mv/msg/283184/788470/#msg_788470
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Weaving
Dynamic weaving is performed at runtime, when Entities are loaded. Once they are loaded it is too late for them to be woven again, and so this cannot work the way you are intending it to with a MetadataSource repository.
Best Regards,
Chris]]>Chris Delahunt2012-02-01T21:26:30-00:00Re: Custom MetadataSource and Dynamic Weaving
https://www.eclipse.org/forums/index.php/mv/msg/283184/788494/#msg_788494
after the CustomMetadataSource returns the entity mappings.
So what I find is that if the mappings are described in a physical eclipselink-orm.xml file in my classpath, entities get weaved. If, instead, I generate the exact same mappings via the CustomMetadataSource (which extends XMLMetadataSource), entities do not get weaved.
Source to my CustomMetadataSource is attached. (I referred to it as CustomMetadataSource above for discussion purposes but the class is actually named EclipseLinkMetadataSource so just ignore the discrepancy.)]]>Mike Gorman2012-02-01T21:59:26-00:00Re: Custom MetadataSource and Dynamic Weaving
https://www.eclipse.org/forums/index.php/mv/msg/283184/788496/#msg_788496
So what I find is that if the mappings are described in a physical eclipselink-orm.xml file in my classpath, entities get weaved. If, instead, I generate the exact same mappings via the CustomMetadataSource (which extends XMLMetadataSource), entities do not get weaved.]]>Mike Gorman2012-02-01T21:59:27-00:00Re: Custom MetadataSource and Dynamic Weaving
https://www.eclipse.org/forums/index.php/mv/msg/283184/788983/#msg_788983
Mike Gorman2012-02-02T13:14:58-00:00Re: Custom MetadataSource and Dynamic Weaving
https://www.eclipse.org/forums/index.php/mv/msg/283184/788985/#msg_788985
Mike Gorman2012-02-02T13:14:58-00:00