Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

How to unenhance entities ?

Sébastien Ursini

2010-03-17

Replies: Find Java Web Hosting

Author LoginPost Reply
Hello,
I'm having an issue trying to make reporting(FOP) with my EJB entities. When
i remote call my EJB service in eclipse and i try to serialize(XStream) my
entity from my eclipse Junit test i obtain the following xml result :

<?xml version='1.0'
encoding='utf-8'?><com.ubiteck.mobideal.reporting.ReportNode>
<company>
  <id>3</id>
  <code>Capital_paris</code>
  <name>Capital </name>
  <location>Paris</location>
  <confirmationEmails>....</confirmationEmails>
  <enabled>false</enabled>
  <type>BROKER_CLIENT</type>
  <language>FR</language>
</company>
......

but when i try the same source code in a Geronimo application server, i'm
having the following result :

<?xml version='1.0'
encoding='utf-8'?><com.ubiteck.mobideal.reporting.ReportNode>
<company serialization="custom">
  <com.ubiteck.mobideal.storage.entity.party.Company>
   <default>
    <enabled>false</enabled>
    <address serialization="custom">
      <Address>
       <default>
        <id>3</id>
       </default>
      </Address>
    </address>
    <addresses class="org.apache.openjpa.util.java$util$ArrayList$proxy"
serialization="custom">
      <unserializable-parents/>
      <list>
       <default>
        <size>0</size>
       </default>
       <int>10</int>
      </list>
    </addresses>
    <code>Capital_paris</code>
    <confirmationEmails>....</confirmationEmails>
    <id>3</id>
......

It seems that the result depends on if i am in the same JVM or not.
Entities returned within the container are enhanced with proxy. I tried to
detach the entities without success.

I would like to return simple POJO not enhanced. How can i do this ?

Thanks in advance for your help
©2008 gg3721.com - Jax Systems, LLC, U.S.A.