You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Amit Nijhawan <am...@gmail.com> on 2022/08/26 04:44:17 UTC
Camel Dozer class nested field mapping issue
Hi,
0
<https://stackoverflow.com/posts/73473054/timeline>
I have a mapping below :
I am using the task model class in EmployeeTaskEx class, so able to convert
field from au.com.EmployeeTaskEx to com.software.EmployeeTaskEx, but if you
see another mapping like nested so getting null value for
com.Software.Task. Any idea how can I proceed further?
<mapping map-null="false" type="one-way">
<class-a>au.com.EmployeeTaskEx</class-a>
<class-b>com.software.EmployeeTaskEx</class-b>
</mapping>
<mapping map-null="false" type="one-way">
<class-a>au.com.data.Task</class-a>
<class-b>com.Software.Task</class-b>
Getting below error: java.lang.NullPointerException:Cannot invoke
"com.com.Software.Task.getID()" because the return value of
"com.software.EmployeeTaskEx.getTask()" is null
Regards,
Amit
Re: Camel Dozer class nested field mapping issue
Posted by Claus Ibsen <cl...@gmail.com>.
its more of a general dozer question - dozer is not so active maintained so
maybe its not possible, and then you can reach out to them to ask for help
/ or how to enhance dozer.
On Fri, Aug 26, 2022 at 8:32 AM Amit Nijhawan <am...@gmail.com>
wrote:
> Hi,
>
> 0
> <https://stackoverflow.com/posts/73473054/timeline>
>
> I have a mapping below :
>
> I am using the task model class in EmployeeTaskEx class, so able to convert
> field from au.com.EmployeeTaskEx to com.software.EmployeeTaskEx, but if you
> see another mapping like nested so getting null value for
> com.Software.Task. Any idea how can I proceed further?
>
>
> <mapping map-null="false" type="one-way">
> <class-a>au.com.EmployeeTaskEx</class-a>
> <class-b>com.software.EmployeeTaskEx</class-b>
>
> </mapping>
>
>
> <mapping map-null="false" type="one-way">
> <class-a>au.com.data.Task</class-a>
> <class-b>com.Software.Task</class-b>
>
>
>
>
> Getting below error: java.lang.NullPointerException:Cannot invoke
> "com.com.Software.Task.getID()" because the return value of
> "com.software.EmployeeTaskEx.getTask()" is null
>
>
> Regards,
>
> Amit
>
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2