Comments (8)
Yea, if you could post/attach/e-mail a JUnit test that would be great.
from modelmapper.
E-Mail sent. Could not attach it here.
from modelmapper.
Maybe fixed in versions > 0.5.4
from modelmapper.
The test actually passes for me with versions >= 0.4.0
from modelmapper.
Hmm, how could that be?
I am using JDK 1.7.11, Modelmapper 0.5.4 and JUnit 4.8.1.
Could you send me your running version of the test back? If you run it in eclipse or whatever IDE, please send me the whole code project.
from modelmapper.
Not sure - Mailed you my test project though.
from modelmapper.
It turned out I imported the User class from another package. Thus mapping did not apply. Thank you four your support.
However, this brings us to the problem I analysed before I ran into the failing test. It appears that the order in which type maps are created affects mapping.
Lets assume I create the following type map:
createTypeMap(ProjetType, Project)
createTypeMap(UserType, Person)
And now lets assume I change ordering as follows:
createTypeMap(UserType, Person)
createTypeMap(ProjetType, Project)
Mapping results shall be the same (in my opinion) but actually they are not. I modified the test and sent it back to you. Would be nice if you could take a look at it. And give some feedback.
from modelmapper.
Thanks for the followup. This is a known issue that indeed has to do with the order in which TypeMaps are created. See issue #25. This is a high priority for me to fix next, but for now I'll close this issue.
from modelmapper.
Related Issues (20)
- How to skip not loaded Lazy fields?
- Test fails after upgrading from 3.1.0 to 3.1.1
- Java 21 support HOT 18
- Support of Java Module System
- Custom mapping in nested objects HOT 4
- Skip field of generic class HOT 1
- Mapping Source object to Destination object
- Mapping nested generic object with generic HOT 1
- Use specific converter for one field
- Model Mapper does not map values correctly (Intermittent - once in a few tries)
- Model Mapper Low performance
- Jackson Module: @JsonTypeInfo support for automatically handling inheritance HOT 1
- ModelMapper fails to map nested entity user field HOT 1
- When condition does not work for null-field
- How to ignore mapping errors HOT 1
- ModelMapper not working with nested generics
- modelmapper Hot deployment HOT 1
- How to Throw Validation exception when Source has a property that cannot be mapped to Destination HOT 1
- Test dependencies upgrade
- Basic Mapping doesn't work as expected.
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 modelmapper.