[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] EntityManager.copy/fetch and embeddables
|
Embeddable:
<orm:embeddable class="ItemColor">
<orm:attributes>
<orm:basic name="colorName">
<orm:column name="TEXT2" nullable="true"/>
</orm:basic>
</orm:attributes>
</orm:embeddable>
In my Entity Item:
<orm:embedded name="color" />
toString of my CopyGroup:
CopyGroup()(depth = CASCADE_TREE, reset key = false, reset version =
false){compItemNo, whItemNo, ynSupplyChainPriority, styleNo, id, text1,
versionTimestamp, color}
after loading the entity color is present.
em.copy(entity, group) brings color at the result to null.
Andrei Ilitchev wrote:
>
> What's the embedded look like?
>
> On 2/28/2012 11:22 AM, sr_dd wrote:
>>
>> First prob:
>> reproducer is on my todo-list.
>>
>> Second prob:
>> Even when i add the whole embedded to the copyGroup the result is the
>> same .
>> As additional info: i use a descriptorcusomizer to allow the embedded to
>> be
>> null.
>>
>> Other solutions?
>>
>> Stefan
>>
>>
>> Andrei Ilitchev wrote:
>>>
>>> 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
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>>>
>>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
--
View this message in context: http://old.nabble.com/EntityManager.copy-fetch-and-embeddables-tp33405429p33408356.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.