org.mapstruct.Mapping Java Examples

The following examples show how to use org.mapstruct.Mapping. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: User2UserVoMapper.java    From dubbo-spring-boot-learning with MIT License 6 votes vote down vote up
/**
 * userDto to userVo
 *
 * @param user 用户
 * @return UserVo
 */
@Mappings({
        @Mapping(target = "id", source = "user.id"),
        @Mapping(target = "name", source = "user.name"),
        @Mapping(target = "birth", source = "user.birth")
})
UserVo user2UserVo(UserDto user);
 
Example #2
Source File: ProductCateConverter.java    From gpmall with Apache License 2.0 6 votes vote down vote up
@Mappings({
        @Mapping(source = "id",target = "id"),
        @Mapping(source = "name",target = "name"),
        @Mapping(source = "parentId",target = "parentId"),
        @Mapping(source = "isParent",target = "isParent"),
        @Mapping(source = "icon",target = "iconUrl")
})
ProductCateDto item2Dto(ItemCat itemCat);
 
Example #3
Source File: LevelMapper.java    From TeamDojo with Apache License 2.0 5 votes vote down vote up
@Mapping(source = "dimension.id", target = "dimensionId")
@Mapping(source = "dimension.name", target = "dimensionName")
@Mapping(source = "dependsOn.id", target = "dependsOnId")
@Mapping(source = "dependsOn.name", target = "dependsOnName")
@Mapping(source = "image.id", target = "imageId")
@Mapping(source = "image.name", target = "imageName")
LevelDTO toDto(Level level);
 
Example #4
Source File: ProjectRoMapper.java    From AuTe-Framework with Apache License 2.0 5 votes vote down vote up
@Mappings({
        @Mapping(target = "projectCode", ignore = true),
        @Mapping(target = "name", source = "name"),
        @Mapping(target = "scenarioGroup", source = "scenarioGroup"),
        @Mapping(target = "stepList", ignore = true),
        @Mapping(target = "beforeScenarioIgnore", source = "beforeScenarioIgnore"),
        @Mapping(target = "afterScenarioIgnore", source = "afterScenarioIgnore")
})
abstract ScenarioRo scenarioToScenarioRoInner(Scenario scenario);
 
Example #5
Source File: UserMapper.java    From spring-cloud-gray with Apache License 2.0 5 votes vote down vote up
@Mapping(target = "roles", expression="java(ary2str(m.getRoles()))")
void model2do(UserInfo m, @MappingTarget UserDO d);
 
Example #6
Source File: ProjectRoMapper.java    From AuTe-Framework with Apache License 2.0 5 votes vote down vote up
@Mappings({
        @Mapping(target = "mqService", source = "mqService"),
        @Mapping(target = "host", source = "host"),
        @Mapping(target = "port", source = "port"),
        @Mapping(target = "username", source = "username"),
        @Mapping(target = "password", source = "password")
})
public abstract AmqpBrokerRo convertAmqpBrokerToRo(AmqpBroker amqpBroker);
 
Example #7
Source File: ProjectRoMapper.java    From AuTe-Framework with Apache License 2.0 5 votes vote down vote up
@Mappings({
        @Mapping(target = "name", source = "name"),
        @Mapping(target = "beforeScenarioPath", source = "beforeScenarioPath"),
        @Mapping(target = "afterScenarioPath", source = "afterScenarioPath"),
        @Mapping(target = "code", source = "code"),
        @Mapping(target = "stand", source = "stand"),
        @Mapping(target = "useRandomTestId", source = "useRandomTestId"),
        @Mapping(target = "testIdHeaderName", source = "testIdHeaderName"),
        @Mapping(target = "groupList", source = "groupList")
})
abstract public ProjectRo projectToProjectRo(Project project);
 
Example #8
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Review entityToApi(ReviewEntity entity);
 
Example #9
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
ReviewEntity apiToEntity(Review api);
 
Example #10
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
ReviewEntity apiToEntity(Review api);
 
Example #11
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Review entityToApi(ReviewEntity entity);
 
Example #12
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rate", source="entity.rating"),
    @Mapping(target = "serviceAddress", ignore = true)
})
Recommendation entityToApi(RecommendationEntity entity);
 
Example #13
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Review entityToApi(ReviewEntity entity);
 
Example #14
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rate", source="entity.rating"),
    @Mapping(target = "serviceAddress", ignore = true)
})
Recommendation entityToApi(RecommendationEntity entity);
 
Example #15
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rating", source="api.rate"),
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
RecommendationEntity apiToEntity(Recommendation api);
 
Example #16
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Review entityToApi(ReviewEntity entity);
 
Example #17
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
ReviewEntity apiToEntity(Review api);
 
Example #18
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rating", source="api.rate"),
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
RecommendationEntity apiToEntity(Recommendation api);
 
Example #19
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Review entityToApi(ReviewEntity entity);
 
Example #20
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rating", source="api.rate"),
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
RecommendationEntity apiToEntity(Recommendation api);
 
Example #21
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rate", source="entity.rating"),
    @Mapping(target = "serviceAddress", ignore = true)
})
Recommendation entityToApi(RecommendationEntity entity);
 
Example #22
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
ReviewEntity apiToEntity(Review api);
 
Example #23
Source File: ProductMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Product entityToApi(ProductEntity entity);
 
Example #24
Source File: RecommendationMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "rate", source="entity.rating"),
    @Mapping(target = "serviceAddress", ignore = true)
})
Recommendation entityToApi(RecommendationEntity entity);
 
Example #25
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Review entityToApi(ReviewEntity entity);
 
Example #26
Source File: ProductMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Product entityToApi(ProductEntity entity);
 
Example #27
Source File: TeamMapper.java    From TeamDojo with Apache License 2.0 4 votes vote down vote up
@Mapping(source = "image.id", target = "imageId")
@Mapping(source = "image.name", target = "imageName")
TeamDTO toDto(Team team);
 
Example #28
Source File: ProductMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
ProductEntity apiToEntity(Product api);
 
Example #29
Source File: ProductMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "serviceAddress", ignore = true)
})
Product entityToApi(ProductEntity entity);
 
Example #30
Source File: ReviewMapper.java    From Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud with MIT License 4 votes vote down vote up
@Mappings({
    @Mapping(target = "id", ignore = true),
    @Mapping(target = "version", ignore = true)
})
ReviewEntity apiToEntity(Review api);