-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GETP-203 fix: Mapper에서 source가 null임에도 내부 필드가 null인 target으로 매핑하는 오류 수정
- Loading branch information
Showing
11 changed files
with
165 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 13 additions & 7 deletions
20
src/main/java/es/princip/getp/persistence/adapter/member/MemberPersistenceMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
package es.princip.getp.persistence.adapter.member; | ||
|
||
import es.princip.getp.domain.member.model.Member; | ||
import es.princip.getp.domain.member.model.ServiceTermAgreement; | ||
import es.princip.getp.domain.member.model.*; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.NullValueCheckStrategy; | ||
|
||
@Mapper(componentModel = "spring") | ||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) | ||
public interface MemberPersistenceMapper { | ||
|
||
@Mapping(source = "email", target = "email.value") | ||
@Mapping(source = "password", target = "password.value") | ||
@Mapping(source = "nickname", target = "nickname.value") | ||
@Mapping(source = "phoneNumber", target = "phoneNumber.value") | ||
@Mapping(source = "profileImageUrl", target = "profileImage.url") | ||
Member mapToDomain(MemberJpaEntity memberJpaEntity); | ||
|
||
@Mapping(target = "email", source = "email.value") | ||
@Mapping(target = "password", source = "password.value") | ||
@Mapping(target = "nickname", source = "nickname.value") | ||
@Mapping(target = "phoneNumber", source = "phoneNumber.value") | ||
@Mapping(target = "profileImageUrl", source = "profileImage.url") | ||
@Mapping(target = "profileImage", source = "profileImage.url") | ||
MemberJpaEntity mapToJpa(Member member); | ||
|
||
@Mapping(source = "tag", target = "tag.value") | ||
ServiceTermAgreement mapToDomain(ServiceTermAgreementJpaVO serviceTermAgreementJpaVO); | ||
|
||
@Mapping(target = "tag", source = "tag.value") | ||
ServiceTermAgreementJpaVO mapToJpa(ServiceTermAgreement serviceTermAgreement); | ||
|
||
@Mapping(source = "value", target = "value") | ||
PhoneNumber mapToPhoneNumber(String value); | ||
|
||
@Mapping(source = "value", target = "value") | ||
Nickname mapToNickname(String value); | ||
|
||
@Mapping(source = "value", target = "url") | ||
ProfileImage mapToProfileImage(String value); | ||
} |
Oops, something went wrong.