Generate question bank domain model from JDL
This commit is contained in:
1 parent
1d97cc4e31
commit
1d74d8f04b
160 files changed
+26900
-2
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package com.example.questionbank.service.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.mapstruct.BeanMapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.Named;
|
||||
import org.mapstruct.NullValuePropertyMappingStrategy;
|
||||
|
||||
/**
|
||||
* Contract for a generic dto to entity mapper.
|
||||
*
|
||||
* @param <D> - DTO type parameter.
|
||||
* @param <E> - Entity type parameter.
|
||||
*/
|
||||
|
||||
public interface EntityMapper<D, E> {
|
||||
E toEntity(D dto);
|
||||
|
||||
D toDto(E entity);
|
||||
|
||||
List<E> toEntity(List<D> dtoList);
|
||||
|
||||
List<D> toDto(List<E> entityList);
|
||||
|
||||
@Named("partialUpdate")
|
||||
@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
|
||||
void partialUpdate(@MappingTarget E entity, D dto);
|
||||
}
|
||||
Reference in new issue
Block a user