Modelmapper 无法映射整个模型?
Modelmapper cannot map the whole model?
我在映射稍微复杂一点的对象时遇到问题,实际上它只映射了对象的一半。
对象是:
{
"firstName": "John",
"lastName": "John",
"description": "Its running",
"personalWebsite": "www.asd.com",
"country": "USA",
"email": "john@john.com",
"pictureBindingModel": {
"pictureUrl": "john.com"
},
"languageBindingModels": [{
"language": "Spanish",
"languageLevelBindingModel": {
"languageLevel": "Advanced"
}
}],
"workSphereBindingModels": [{
"workSphere": "IT",
"subSphereBindingModels": [{
"subSphere": "Programming"
}]
}],
"skillBindingModels": [{
"skill": "Spring data",
"skillLevelBindingModel": {
"skillLevel": "Beginner"
}
}],
"educationBindingModels": [{
"countryBindingModel": {
"country": "USA"
},
"universityName": "Harvard",
"titleTypeBindingModel": {
"titleType": "Ph.D"
},
"educationSubject": "Java programming",
"graduationYear": 2020
}],
"certificateBindingModels": [{
"certificateSubject": "Spring master",
"awardedFrom": "Harvard",
"graduationYear": 2021
}]
}
有很多嵌套对象,它们是集合,它只完成了一半的工作。我使用“MatchingStrategies.LOOSE”。
绑定模型也填对了,结构和实体一样!
3 个未映射的字段:
问题是 educationBindingModels
,certificateBindingModels
是 Education
以及你的 Pojo 中的 certificates
它应该是同名的。名称和映射对象不同,应该相同。
我在映射稍微复杂一点的对象时遇到问题,实际上它只映射了对象的一半。
对象是:
{
"firstName": "John",
"lastName": "John",
"description": "Its running",
"personalWebsite": "www.asd.com",
"country": "USA",
"email": "john@john.com",
"pictureBindingModel": {
"pictureUrl": "john.com"
},
"languageBindingModels": [{
"language": "Spanish",
"languageLevelBindingModel": {
"languageLevel": "Advanced"
}
}],
"workSphereBindingModels": [{
"workSphere": "IT",
"subSphereBindingModels": [{
"subSphere": "Programming"
}]
}],
"skillBindingModels": [{
"skill": "Spring data",
"skillLevelBindingModel": {
"skillLevel": "Beginner"
}
}],
"educationBindingModels": [{
"countryBindingModel": {
"country": "USA"
},
"universityName": "Harvard",
"titleTypeBindingModel": {
"titleType": "Ph.D"
},
"educationSubject": "Java programming",
"graduationYear": 2020
}],
"certificateBindingModels": [{
"certificateSubject": "Spring master",
"awardedFrom": "Harvard",
"graduationYear": 2021
}]
}
有很多嵌套对象,它们是集合,它只完成了一半的工作。我使用“MatchingStrategies.LOOSE”。
绑定模型也填对了,结构和实体一样!
3 个未映射的字段:
问题是 educationBindingModels
,certificateBindingModels
是 Education
以及你的 Pojo 中的 certificates
它应该是同名的。名称和映射对象不同,应该相同。