Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] EntityManager.copy/fetch and embeddables

On 2/28/2012 6:58 AM, sr_dd wrote:

Hi,

i use EL 2.3.2 and work with large object-trees. In order to specify the
fetched object-tree before serialization (especially to reduce it) and
sending to an client i use the copy functionality with AttributeGroups.

First problem i had:
In some cases em.copy(List,AttributeGroup) throws several exceptions
resulting out of unloaded fields, i think if the same object occurs more
then once in the object tree.  I work around this by first executing
em.load(List,AttributeGroup) and afterwards using copy.
Loading the group upfront is a good idea - can't copy an object without loading it first. However I think that copy should still work without it. May be you could post a simple example reproducing this problem.

Second Problem:
em.copy does not set embeddables. The fields are empty even when i specified
them in the CopyGroup.
The whole embedded object could be added to AttributeGroup (group.addAttribute(embedded)). However "splitting" the embedded object to include a subset of its attributes into the group is not supported (group.addAttribute(embedded.attr1)).


Has anybody an idea about that?

regards
Stefan


Back to the top