Generator-jhipster: Use MapStruct instead of UserMapper and PasswordChangeDT. MapStruct 1.4.0.Final is out

Created on 5 Nov 2020  路  5Comments  路  Source: jhipster/generator-jhipster

Overview of the feature request

No more need for hand-made UserMapper and also bump version

Motivation for or Use Case
/**
 * Mapper for the entity {@link User} and its DTO called {@link UserDTO}.
 *
 * Normal mappers are generated using MapStruct, this one is hand-coded as MapStruct
 * support is still in beta, and requires a manual step with an IDE.
 */
@Service
public class UserMapper {
Related issues or PR
  • [ x] Checking this box is mandatory (this is just to show you read everything)
area mapstruct

Most helpful comment

100% agree.
For my real projects, I always use dto+service by default, as it can't work without mapstruct

All 5 comments

@tillias : I think it's because mapstruct is optional, when using entities. Unless we change this and put mapstruct by default with DTO

@pascalgrimaud now that dto is not flatten anymore, I would agree to drop non dto option.
Dropping non-dto and non-service would reduce a lot our test cases.
IMO we could reopen https://github.com/jhipster/generator-jhipster/issues/11589.
Force entities to dto as mapstruct and service as serviceClass or serviceImpl.
And drop implementations during jhipster 7 cycle.

100% agree.
For my real projects, I always use dto+service by default, as it can't work without mapstruct

Hi folks, with new IntelliJ 2020.3 this is a critical issue (of course if Java 11 is used) see https://youtrack.jetbrains.com/issue/IDEA-200481

I can confirm that tests can't be run out of intelliJ 2020.3 anymore.

Any chance you can at least bump version to 1.4.1 in upcoming release?

For all other using JHipster 6x workaround is

<mapstruct.version>1.4.1.Final</mapstruct.version>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
            <scope>provided</scope>
        </dependency>

I'm also not sure why those dependencies do not use ${mapstruct.version} anyways...

thanks a lot for your suggestion @tillias
I'm keeping it in mind, in case of a new patch release for v6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaidohallik picture kaidohallik  路  3Comments

SudharakaP picture SudharakaP  路  3Comments

DanielFran picture DanielFran  路  3Comments

marcelinobadin picture marcelinobadin  路  3Comments

Steven-Garcia picture Steven-Garcia  路  3Comments