Skip to main content


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 18:55 Go to next message
jason zhang is currently offline jason zhangFriend
Messages: 31
Registered: July 2009
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 405 times)
Re: AggregateCollectionMapping in DyanmicMapping [message #918519 is a reply to message #918110] Fri, 21 September 2012 04:52 Go to previous messageGo to next message
jason zhang is currently offline jason zhangFriend
Messages: 31
Registered: July 2009
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 14:50 Go to previous message
James Sutherland is currently offline James SutherlandFriend
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 Apr 19 04:09:17 GMT 2024

Powered by FUDForum. Page generated in 0.07144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top