Automatically create (private) mapping methods to map nested properties #60

Closed
agudian opened this Issue Jul 25, 2013 · 7 comments

Projects

None yet

3 participants

@agudian
Member
agudian commented Jul 25, 2013

No description provided.

@gunnarmorling
Member

Relates to #3 and #4.

@agudian
Member
agudian commented Sep 15, 2013

Also relates to #65

@agudian
Member
agudian commented Feb 4, 2015

What I meant here were forged methods for bean properties.

@gunnarmorling
Member

@agudian Is there actually anything left to be done here? we already create forged methods for mapping nesting props, right? If that's not what you have in mind, could you add an example?

@agudian
Member
agudian commented Feb 8, 2015

Example:

class Car {
    private SteeringWheel steeringWheel;
    private List<Seat> seats;
...
}
// classes CarDto, SteeringWheel, SteeringWheelDto, Seat, SeatDto look equally dull and don't contain any property name differences

In my Mapper, I'd like to just write:

@Mapper
interface CarMapper {
  CarDto toCarDto( Car car );
  Car toCar( CarDto dto );
}

Right now, we report errors on unmappable target properties, and suggest to declare mapping methods for SteeringWheel <-> SteeringWheelDto and Seat <-> SeatDto.
The idea was to create forged methods for those cases as well, so that I'd only have to declare them myself if I need to fine-tune the mapping or want to publicly expose those methods in my mapper interface.

We can't do that, yet, can we?

@sjaakd
Contributor
sjaakd commented Feb 17, 2015

We can't do that, yet, can we?

Nope.. But I would really like such a feature. Especially in combination with #168 and #292 😄

@navpil navpil added a commit to navpil/mapstruct that referenced this issue Oct 18, 2016
@navpil navpil #60 Working implementation of automap aa6db3a
@navpil navpil added a commit to navpil/mapstruct that referenced this issue Oct 18, 2016
@navpil navpil #60 Fix tests so they pass with the automap functionality 3783f85
@navpil navpil added a commit to navpil/mapstruct that referenced this issue Oct 24, 2016
@navpil navpil #60 Fix some additional tests so they pass with the utomapping in pla…
…ce. One eclipse specific tests still fails.
a77d350
@navpil navpil added a commit to navpil/mapstruct that referenced this issue Oct 24, 2016
@navpil navpil #60 Tests for automap feature cc70eac
@navpil navpil added a commit to navpil/mapstruct that referenced this issue Oct 25, 2016
@navpil navpil #60 Automapping d67b6df
@navpil navpil added a commit to navpil/mapstruct that referenced this issue Dec 7, 2016
@navpil navpil #60 Automapping 6a4f3a7
@sjaakd sjaakd added a commit to sjaakd/mapstruct that referenced this issue Dec 18, 2016
@sjaakd sjaakd #60 Automapping f0b5826
@sjaakd sjaakd added a commit that referenced this issue Dec 19, 2016
@navpil @sjaakd navpil + sjaakd #60 automapping 81ce660
@sjaakd
Contributor
sjaakd commented Dec 19, 2016

@navpil thanks for the great work!

@sjaakd sjaakd closed this Dec 19, 2016
@sjaakd sjaakd added a commit to sjaakd/mapstruct that referenced this issue Dec 19, 2016
@sjaakd sjaakd #60 removing comments 8580e3f
@sjaakd sjaakd added the feature label Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment