java - Dozer - Mapping Collections -


I have a scenario that is similar to the following two classes:

  public class Person {private string name; Private set & lt; Person & gt; Family members; // Constructor & amp; Gates and Sets}}   

person class is my source class. I am trying to use Dover to map this range in the following sections:

  public class PersonPrime {Private string person name; Family member family member; // Constructor & amp; Gates and Sets} Public Class Familymakers {Private list & lt; PersonPrime & gt; Family members; // Constructor & amp; Geters and setters} In my actual scenario, target classes were created by JACAB (which I have created using XSDs) were set to XSD and I did not actually convert them. So, target classes can not be changed. I am currently able to map archives to my mapping XML files, but I can not map the archive.  

By any thought how can I use the dozer to map person object to an object type of PersonPrime ?

By default the JaxB does not generate the set for the archive "Family member" type Dosage from within (Org.dozer.util.ReflectionUtils.java:323 Dozer 5.4.0) will be an inefficient indicator exception within the guts, when the Dozer tries to call the non-existent setter. To avoid this, you need to establish a truly accessible area in the collection, so that they can set up family members. Thus, the following modified mapping should work:

  & lt; Mapping & gt; & Lt; Class A & gt; Person & lt; / Square one & gt; & Lt; Square p & gt; PersonPrime & lt; / Square p & gt; & Lt; Region & gt; & Lt; A & gt; Name & lt; / A & gt; & Lt; P & gt; PERSONNAME & lt; / P & gt; & Lt; / Region & gt; & Lt; Region & gt; & Lt; A & gt; Family member & lt; / A & gt; & Lt; B is-accessible = "true" & gt; Family member Family member & lt; / B & gt; & Lt; / Region & gt; & Lt; / Mapping & gt;    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -