My source or destination is a generated class with getters and setters.
However the arrays are presized since it is determined by a copybook size.
So I have a source and destination array with 100 elements.
I want dozer to copy or map each index.
Not add or update logic it is doing now.
I've worked with the mappings quite a bit and I get one of the following scenarios:
1) I get an array with 200 elements with the values from my source array starting at the 101 element.
2) I get an array with 102 elements (assuming only 2 of 100 elements in source array has a value) with my values starting at the 101 element
3) I get a null pointer exception because the source element has a null value in the array.
I want my two values copied from my source array to my destination array so that I have 100 element array with the first two positions having my values.
I've attached a couple unit tests to demonstrate a bit and if you can make them pass by only changing the mapping files then that is what I want.
I've struggled with collections in this way in the past without generated classes which leads doing extra work outside of dozer or hacking your beans up. It would be nice to have some more options/control
Log in to post a comment.