openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Woods (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (OPENJPA-1571) The change in the element collection is not persisted to the database during merging a detached entity
Date Sun, 21 Mar 2010 00:12:27 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-1571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Donald Woods resolved OPENJPA-1571.
-----------------------------------

    Resolution: Fixed

Fixed by r925416 checked in using OPENJPA-1097.

> The change in the element collection is not persisted to the database during merging
a detached entity
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1571
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1571
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta2
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>
> Given an entity:
> @Entity
> public class EntityB {
>     @Id
>     private int id; 
>     
>     @ElementCollection(fetch = FetchType.EAGER)
>     @CollectionTable(name = "setIntegerTable", joinColumns = @JoinColumn(name = "parent_id"))
>     @Column(name = "value")
>     private Set<Integer> intVals;
> ...
> }
> The following test scenario 
>         EntityB b1 = em.find(EntityB.class, id);
>         em.clear();
>         b1.getIntVals().remove(new Integer(1));
>         b1.getIntVals().add(new Integer(2)); 
>         
>         em.getTransaction().begin();
>         EntityB b2 = em.merge(b1);
>         em.getTransaction().commit();
>         em.clear();
>         EntityB b3 = em.find(EntityB.class, id);
>         Set<Integer> intVals = b3.getIntVals();
>         ==> this intVals still only contains Integer(1), not Integer(2).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message