Overview of the issue
[Enhancement] EntityMapper should be invoked from EntityResource only even if EntityService is present
Motivation for or Use Case
In my point of view, EntityService shouldn't bother with DTO <-> Entity conversion, that's only EntityResource responsibility. EntityService should only see entities, and not make any reference to rest package
JHipster Version(s)
2.27.0
JHipster configuration, a .yo-rc.json file generated in the root folder
Example :
{
"generator-jhipster": {
"applicationType": "monolith",
"baseName": "sampleDefaultFromScratch",
"packageName": "com.mycompany.myapp",
"packageFolder": "com/mycompany/myapp",
"authenticationType": "session",
"hibernateCache": "ehcache",
"clusteredHttpSession": "no",
"websocket": "no",
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": "no",
"useSass": false,
"buildTool": "maven",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": ["en", "fr"],
"enableSocialSignIn": false,
"rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb",
"testFrameworks": [
"gatling"
]
}
}
Entity configuration(s) entityName.json files generated in the .jhipster directory
{
"relationships": [],
"fields": [
{
"fieldName": "label",
"fieldType": "String",
"fieldValidateRules": [
"required",
"minlength"
],
"fieldValidateRulesMinlength": "3"
}
],
"changelogDate": "20150805124936",
"dto": "mapstruct",
"pagination": "pagination",
"service": "serviceClass"
}
Suggest a Fix
I can submit a PR for that
Overview of the issue
[Enhancement]
EntityMappershould be invoked fromEntityResourceonly even ifEntityServiceis presentMotivation for or Use Case
In my point of view,
EntityServiceshouldn't bother with DTO <-> Entity conversion, that's onlyEntityResourceresponsibility.EntityServiceshould only see entities, and not make any reference torestpackageJHipster Version(s)
2.27.0
JHipster configuration, a
.yo-rc.jsonfile generated in the root folderExample :
Entity configuration(s)
entityName.jsonfiles generated in the.jhipsterdirectorySuggest a Fix
I can submit a PR for that