Coder Social home page Coder Social logo

Comments (7)

gunnarmorling avatar gunnarmorling commented on July 20, 2024

Relates to #3 and #4.

from mapstruct.

agudian avatar agudian commented on July 20, 2024

Also relates to #65

from mapstruct.

agudian avatar agudian commented on July 20, 2024

What I meant here were forged methods for bean properties.

from mapstruct.

gunnarmorling avatar gunnarmorling commented on July 20, 2024

@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?

from mapstruct.

agudian avatar agudian commented on July 20, 2024

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?

from mapstruct.

sjaakd avatar sjaakd commented on July 20, 2024

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

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

from mapstruct.

sjaakd avatar sjaakd commented on July 20, 2024

@navpil thanks for the great work!

from mapstruct.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.