#111 Mapping deep level field in Indexed structure

closed
None
9
2007-07-15
2007-07-12
Raja
No

Hi Guys,
Consider something like this...

Souce classes
-------------
class ScenarioDTO {
private BorrowerDTO borrowerDTO ;
//getter-setters
}

class BorrowerDTO {
private Employment employment;
//getter-setters
}

class Employment {
private String selfEmployed;
//getter-setters
}

Target classes
--------------

class DD {
private BorrowerList borrowerList;
//getter-setters
}
class BorrowerList {
private Borrower[] borrower;
//getter-setters
}

class Borrower {
private Employment employment;
//getter-setters
}

class Employment {
private Boolean isSelfEmployed;
//getter-setters
}

I am making the following entry for this in the bean mapper XML...

<mapping>
<class-a>com.test.ScenarioDTO</class-a>
<class-b>com.input.DD</class-b>
<field>
<a>BorrowerDTO.Employment.selfEmployed</a>
<b>BorrowerList.Borrower[0]</b>
<b-hint>Employment.isSelfEmployed</b-hint>
</field>
</mapping>

When i am running the program it is giving me this error:
net.sf.dozer.util.mapping.MappingException: java.lang.ClassNotFoundException: Employment.isSelfEmployed

I tried a lot but in vain. Can anyone help me on this? I really need it very urgently.

Thanks a lot in advance !!!

Discussion

  • Raja

    Raja - 2007-07-12
    • priority: 5 --> 9
     
  • Matt Tierney

    Matt Tierney - 2007-07-12

    Logged In: YES
    user_id=1236069
    Originator: NO

    Hi Raja,

    The <hint> is used to specify Class type when needed. It looks like you are trying to overload it with deep mapping logic and I would expect that to throw the exception you are seeing. If I understand your use case correctly, is the following mapping what you are trying to perform(if it was supported)?

    <a>BorrowerDTO.Employment.selfEmployed</a>
    <b>BorrowerList.Borrower[0].employment.isSelfEmployed</b>

    If so, this is a known limitation and there is a feature request to add indexed mapping within deep mapping. The feature request is 1473800.

    http://sourceforge.net/tracker/index.php?func=detail&aid=1473800&group_id=133517&atid=727371

     
  • Raja

    Raja - 2007-07-12
    • status: open --> wont-fix
     
  • Matt Tierney

    Matt Tierney - 2007-07-15
    • assigned_to: nobody --> mhtierney
    • status: wont-fix --> pending
     
  • Matt Tierney

    Matt Tierney - 2007-07-15

    Logged In: YES
    user_id=1236069
    Originator: NO

    index mapping within deep mappings has been implemented

     
  • Matt Tierney

    Matt Tierney - 2007-07-15
    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks