Giter Site home page Giter Site logo

Comments (5)

thunderhook avatar thunderhook commented on June 20, 2024 1

When removing the @SuperBuilder from the target object, then the warnings are shown for me.
Can you tell me if this is the case in your code? If yes, then it is due to #159

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 20, 2024 1

Perfect, will be fixed soon in #159. 👍

from mapstruct-idea.

thunderhook avatar thunderhook commented on June 20, 2024

Hi @aleksvidak

Thank you for the report. I cannot reproduce this. The following sample generates warnings for me (does not matter if mapped from a record or a class):

import org.mapstruct.Mapper;

@Mapper
interface UserRecordMapper {

    UserDto mapFromRecord(UserRecord user);

    UserDto mapFromClass(UserClass user);

}

record UserRecord(String username, String password) { }

record UserDto(String name, String pw) { }

class UserClass {
    public String username;
    public String password;
}

Would you be so kind and post your code of User and UserDto?

from mapstruct-idea.

aleksvidak avatar aleksvidak commented on June 20, 2024

The case is when mapping from record to class.

public record UserDto(String test, String test4) implements Serializable {}

@SuperBuilder(toBuilder = true)
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class User {

  private String test;

  private String test2;

  private String test3;
}

import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
public interface UserMapper {

  User toEntity(UserDto userDto);

  UserDto toDto(User user);
}

from mapstruct-idea.

aleksvidak avatar aleksvidak commented on June 20, 2024

When removing the @SuperBuilder from the target object, then the warnings are shown for me. Can you tell me if this is the case in your code? If yes, then it is due to #159

Yes, when I remove @SuperBuilder, warnings are back.

from mapstruct-idea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.