openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Logemann (JIRA)" <>
Subject [jira] Created: (OPENJPA-1030) detachment with DetachState=fetch-groups doesnt work
Date Thu, 09 Apr 2009 11:11:13 GMT
detachment with DetachState=fetch-groups doesnt work

                 Key: OPENJPA-1030
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.2.1
         Environment: JDK 1.6
            Reporter: Marc Logemann

My persistence.xml is:
<property name="openjpa.DetachState" value="fetch-groups(DetachedStateField=true)"/>

My Domain class header:

   @FetchGroup(name="posDetail", attributes={
public class Order {

   @OneToMany(mappedBy = "order", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
   List<DeliveryAddress> deliveryAddresses;

(in fact i also have the @LoadFetchGroup("posDetail")  to be sure.....)

Now when i am leaving my DAO layer which means that the persistence contexts ends, the delivery
address is "null" even though its in the fetch group and it was populated in the DAO. I even
queried for the fetch group in the DAO before leaving it.

OpenJPAQuery oQuery = OpenJPAPersistence.cast(em.createQuery("select o from Order o where
o.oid = ?1"));
       oQuery.setParameter(1, oid);
       List list = oQuery.getResultList();
       if(list != null && list.size() > 0)  {
           return (Order)list.iterator().next();

I know it must be a detach issue because with the following State it works....
<property name="openjpa.DetachState" value="all"/>

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

View raw message