|
| 1 | +package org.ays.auth.model.mapper; |
| 2 | + |
| 3 | +import org.ays.auth.model.AdminRegistrationApplication; |
| 4 | +import org.ays.auth.model.entity.AdminRegistrationApplicationEntity; |
| 5 | +import org.ays.common.model.mapper.BaseMapper; |
| 6 | +import org.mapstruct.Mapper; |
| 7 | +import org.mapstruct.Mapping; |
| 8 | +import org.mapstruct.factory.Mappers; |
| 9 | + |
| 10 | +/** |
| 11 | + * {@code AdminRegistrationApplicationEntityToDomainWithoutRelationsMapper} is a MapStruct-based mapper interface |
| 12 | + * that defines the transformation logic between {@link AdminRegistrationApplicationEntity} (the persistence model) |
| 13 | + * and {@link AdminRegistrationApplication} (the domain model). |
| 14 | + * <p> |
| 15 | + * This mapper intentionally excludes the {@code user} relation to avoid eager loading or complex object graph mapping, |
| 16 | + * which is especially useful in scenarios where performance and serialization control are critical. |
| 17 | + * </p> |
| 18 | + * |
| 19 | + * <p> |
| 20 | + * An implementation of this interface is automatically generated by MapStruct at compile time. |
| 21 | + * Use the {@link #initialize()} method to access the generated implementation. |
| 22 | + * </p> |
| 23 | + * |
| 24 | + * <p> |
| 25 | + * This interface extends {@link BaseMapper}, which provides generic mapping contract definitions. |
| 26 | + * </p> |
| 27 | + */ |
| 28 | +@Mapper |
| 29 | +public interface AdminRegistrationApplicationEntityToDomainWithoutRelationsMapper extends BaseMapper<AdminRegistrationApplicationEntity, AdminRegistrationApplication> { |
| 30 | + |
| 31 | + |
| 32 | + /** |
| 33 | + * Maps a {@link AdminRegistrationApplicationEntity} to its domain representation {@link AdminRegistrationApplication}, |
| 34 | + * ignoring the {@code user} field. |
| 35 | + * |
| 36 | + * @param source the entity object to be mapped |
| 37 | + * @return the mapped domain object |
| 38 | + */ |
| 39 | + @Override |
| 40 | + @Mapping(target = "user", source = "user", ignore = true) |
| 41 | + AdminRegistrationApplication map(AdminRegistrationApplicationEntity source); |
| 42 | + |
| 43 | + |
| 44 | + /** |
| 45 | + * Initializes and returns the generated mapper implementation. |
| 46 | + * |
| 47 | + * @return an instance of {@link AdminRegistrationApplicationEntityToDomainWithoutRelationsMapper} |
| 48 | + */ |
| 49 | + static AdminRegistrationApplicationEntityToDomainWithoutRelationsMapper initialize() { |
| 50 | + return Mappers.getMapper(AdminRegistrationApplicationEntityToDomainWithoutRelationsMapper.class); |
| 51 | + } |
| 52 | + |
| 53 | +} |
0 commit comments