Hi,
I wonder can you help
I am trying to map tdfiTripcatches which is of type List<tdfiTripcatch>
To speciesOnBoard which is of type List<BaseSpecies>
I have a mapper tripCatchToBaseSpecies which does this and that part is working ok.
I would like to filter the list tdfiTripcatches and then apply the result which would also
Be a List<tdfiTripcatch>. To do this I am using a helper method getTripCatchListForSpeciesOnBoard
I am using the qualifiedByName pattern to do this but in the generated code I can see that the filter method
Is not being called.
I wonder does anyone know what is going wrong here
Any help appreciated
Regards,
Declan
@Mapper(componentModel="spring",
uses={
ZonedDateTimeStampMapper.class,
ConfigMapperFromId.class,
TripEventToGeoInfoMapper.class,
TripeventersMapper.class,
TripCatchLocator.class
},
unmappedTargetPolicy = ReportingPolicy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS
)
public interface TripEventToPnoMapper {
@Mappings(
{
@Mapping(target = "sequenceNum", source = "tripEvent.ersseqno"),
…
@Mapping(target = "speciesOnBoard", qualifiedByName={"TripCatchLocator", "getTripCatchListForSpeciesOnBoard"}, source="tripEvent.tdfiTripcatches" )
}
)
PriorNotificationOfReturnToPort tripEventToPno(Tripevent tripEvent);
//map tripCatch entity to model object BaseSpecies
@Mappings(
{
@Mapping(target = "speciesCode", source = "tripCatch.speciesid", qualifiedByName={"ConfigMapperFromId", "speciesCodeFromId"}),
….
}
)
BaseSpecies tripCatchToBaseSpecies(TdfiTripcatch tripCatch);
}
@Component
@Named("TripCatchLocator")
public class TripCatchLocator {
private ConfigurationService configService = ConfigurationServiceImpl.getInstance();
@Named("getTripCatchListForSpeciesOnBoard")
public List<TdfiTripcatch> getTripCatchListForSpeciesOnBoard(List<TdfiTripcatch> tripcatches) throws ConfigEntryNotFoundException{
return getTripCatchesForType(tripcatches, configService.retrieveConfigIdFromCode("COB", "CatchType"));
}
}
--
You received this message because you are subscribed to the Google Groups "mapstruct-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstruct-users+unsubscribe@googlegroups.com.
To post to this group, send email to mapstruct-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstruct-use...@googlegroups.com.
To post to this group, send email to mapstru...@googlegroups.com.