Comments (7)
from mapstruct.
Also relates to #65
from mapstruct.
What I meant here were forged methods for bean properties.
from mapstruct.
@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.
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.
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.
@navpil thanks for the great work!
from mapstruct.
Related Issues (20)
- Nested Mappings suddenly stop with return null HOT 5
- Incompatible types: CAP#1 cannot be converted to AdditionalRoutePointDTO where CAP#1 is a fresh type-variable: CAP#1 extends RoutePointDTO from capture of ? HOT 7
- Clarify that `Mapping#ignoreByDefault` is inherited in nested mappings in documentation HOT 17
- The resulting implementation class does not have a set value HOT 5
- Add a MapStruct processor option to fail if mappers referenced in uses attribute are not really used HOT 5
- Mapping a list to a map and vice versa
- When @InheritConfiguration and qualifiedByName are used at the same time, it will be invalid when the field names are inconsistent. HOT 8
- @AfterMapping not used when the target object is created with builder HOT 3
- Improve usage of <pre><code> in Javadoc HOT 1
- Compilation Error - Duplicate Methods generated
- Internal error in the mapping processor: ... InvalidReferenceException: ... ==> ext.targetPropertyName HOT 1
- Is there a release date for 1.6.0.Final? HOT 1
- Presence check method used only once when multiple source parameters are provided HOT 7
- Automate releases using JReleaser
- @BeanMapping(ignoreByDefault = true) Implicit mapping error HOT 3
- Reduce configuration code for multiple ignores HOT 1
- Reduce configuration code for after method HOT 3
- Support update-style method for qualifyByName HOT 3
- Compiler argument mapstruct.defaultComponentModel seems to break Spring Batch's Bean detection HOT 3
- @SubclassMapping not working with @BeanMapping.ignoreUnmappedSourceProperties HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapstruct.