ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lamey" <cla...@localmatters.com>
Subject RE: iBatis+xStream
Date Thu, 26 Mar 2009 01:25:24 GMT
Try turning off the lazy loading (it uses the cglib bytecode instrumentation):

<lazyLoadingEnabled>false</lazyLoadingEnabled>

Cheers,
topher

-----Original Message-----
From: AlexElba [mailto:ramalex1@yahoo.com]
Sent: Wed 3/25/2009 3:35 PM
To: user-java@ibatis.apache.org
Subject: Re: iBatis+xStream
 

BTW the file contains this for each group



 <Groups class="dynamic-proxy">
        <interface>set</interface>
        <handler
class="com.ibatis.sqlmap.engine.mapping.result.loader.LazyResultLoader">
          <client>
            <delegate>
              <lazyLoadingEnabled>true</lazyLoadingEnabled>
              <cacheModelsEnabled>true</cacheModelsEnabled>
              <enhancementEnabled>false</enhancementEnabled>
              <useColumnLabel>true</useColumnLabel>
             
<forceMultipleResultSetSupport>false</forceMultipleResultSetSupport>
              <txManager>
                <config
class="com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig">
                  <dataSource
class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
                    <targetDataSource
class="org.apache.commons.dbcp.BasicDataSource">
                      <defaultAutoCommit>true</defaultAutoCommit>
                     
<defaultTransactionIsolation>-1</defaultTransactionIsolation>
                     
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
                      <maxActive>7</maxActive>
                      <maxIdle>3</maxIdle>
.........
...

The problem is this lists must be lazy. I don't want to make them not lazy


AlexElba wrote:
> 
> Hello,
> 
> I am using iBatis to select data from db and after serialize it to xml
> using xStream. During serialization I am getting unnecessary stuff  
> 
> public class Office{
> private String name;
> private Employee employee;
> ..
> getters/setters
> ...
> }
> 
> public class Employee {
> private List<Group> groups;
> ..
> getters/setters
> ...
> 
> }
> 
> public class Group{
> private String x1;
> private String x2;
> private String x3;
> }
> 
> ............Mappings...............
> 
>   <resultMap id="office"
>     class="domain.Office">
>     <result property="name" column="NAME" />
>     <result property="employee" resultMap="nm.employee" />
>   </resultMap>
> 
>   <resultMap id="employee"
>     class="domain.Employee">
>     <result property="groups" column="group_id" select="getGroups" />
>   </resultMap>
> 
>   <resultMap id="group"
>     class="domain.Group">
>     <result ...
>   </resultMap>
> 
>  <select id="getGroups" parameterClass="int"
>     resultMap="nm.group">
>     SELECT * from group where group_id=#gId#
>   </select>
> 
> 
> .........
> 
> 
> When I am trying to serialize whole office object I am getting lot of
> proxy information into my xml.
> 
> I am new in ibatis, but I am sure there will be way to remove proxy from
> object..
> Can someone please help?
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/iBatis%2BxStream-tp22711384p22711437.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.





Mime
View raw message