|
|
Re: Custom MetadataSource and Dynamic Weaving [message #788494 is a reply to message #788470] |
Wed, 01 February 2012 21:59 |
Mike Gorman Messages: 6 Registered: February 2012 |
Junior Member |
|
|
I appreciate and understand that. Once the class is loaded, whatever weaving we need to do needs to get done then. But my CustomMetadataSource is the only thing in the system that should be telling the weaver (javaagent) what to weave. Thus, no attempt to load the class should be made until 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.
For your reference, stand-alone test class:
Map<String, String> props = createJDBCProps();
props.put("eclipselink.metadata-source", CustomMetadataSource.class.getName());
EntityManagerFactory factory = Persistence.createEntityManagerFactory("default", props);
testWeaving(factory);
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.)
[Updated on: Wed, 01 February 2012 22:00] Report message to a moderator
|
|
|
Re: Custom MetadataSource and Dynamic Weaving [message #788496 is a reply to message #788470] |
Wed, 01 February 2012 21:59 |
Mike Gorman Messages: 6 Registered: February 2012 |
Junior Member |
|
|
I appreciate and understand that. Once the class is loaded, whatever weaving we need to do needs to get done then. But my CustomMetadataSource is the only thing in the system that should be telling the weaver (javaagent) what to weave. Thus, no attempt to load the class should be made until 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.
[Updated on: Thu, 02 February 2012 13:12] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03431 seconds