Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » AggregateCollectionMapping in DyanmicMapping(AggregateCollectionMapping does not work for DynamicMapping)
AggregateCollectionMapping in DyanmicMapping [message #918110] Thu, 20 September 2012 14:55 Go to next message
jason zhang is currently offline jason zhang
Messages: 27
Registered: July 2009
Junior Member
I am using the Dynamic Map feature in eclipselink.
I noticed that JPADynamicTypeBuilder does not have a method to add
AggregateCollectionMapping method. AggregateCollectionMapping should
be the one for ElementCollection in JPA for embedded class.
I create and add AggregateCollectionMapping directly to JPADynamicTypeBuilder. Code is attached.
I can save embedded colleciton, and delete them together with owing instance. But I can not modify them(modify one element, remove one, or and one).

In my code, I first call create to create the mapping. I then call save. I check
logged sql and database structure. Embedded collection is saved
correctly. I then call removeOneName1 and removeOneName2 to remove one
embedded object by different approaches. But this removal is just ignored by EntityManager.

Any help is really appreciated.

-jason
  • Attachment: Test1.java
    (Size: 7.58KB, Downloaded 91 times)
Re: AggregateCollectionMapping in DyanmicMapping [message #918519 is a reply to message #918110] Fri, 21 September 2012 00:52 Go to previous messageGo to next message
jason zhang is currently offline jason zhang
Messages: 27
Registered: July 2009
Junior Member
Bump!
Any help is really appreciated!
I have looked into various piece of the source code and can not figure out why this does not work.




thanks.
-jason
Re: AggregateCollectionMapping in DyanmicMapping [message #923035 is a reply to message #918519] Tue, 25 September 2012 10:50 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Please log a bug for this issue and vote for it.

I believe the issue you are seeing is related to change tracking, which defaults to Attribute for dynamic, but Attribute is not support for aggregate collections.
You could try switching your descriptor to use deferred change tracking,


descriptor.setObjectChangePolicy(new DeferredChangeDetectionPolicy());


James : Wiki : Book : Blog : Twitter
Previous Topic:query results cache for report queries?
Next Topic:Creating BLOBs
Goto Forum:
  


Current Time: Fri Aug 29 22:27:31 EDT 2014

Powered by FUDForum. Page generated in 0.01954 seconds