Search in sources :

Example 1 with FishingGearRoleEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class BaseMapper method mapToFishingGears.

public static Set<FishingGearRoleEntity> mapToFishingGears(List<CodeType> codeTypes, FishingGearEntity fishingGearEntity) {
    if (CollectionUtils.isEmpty(codeTypes)) {
        Collections.emptySet();
    }
    Set<FishingGearRoleEntity> fishingGearRoles = newSet();
    for (CodeType codeType : codeTypes) {
        FishingGearRoleEntity gearRole = FishingGearMapper.INSTANCE.mapToFishingGearRoleEntity(codeType);
        gearRole.setFishingGear(fishingGearEntity);
        fishingGearRoles.add(gearRole);
    }
    return fishingGearRoles;
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) FishingGearRoleEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity)

Example 2 with FishingGearRoleEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class BaseActivityViewMapper method fillRoleAndCharacteristics.

private void fillRoleAndCharacteristics(GearDto gearDto, FishingGearEntity gearEntity) {
    Set<FishingGearRoleEntity> fishingGearRole = gearEntity.getFishingGearRole();
    if (CollectionUtils.isNotEmpty(fishingGearRole)) {
        FishingGearRoleEntity role = fishingGearRole.iterator().next();
        gearDto.setRole(role.getRoleCode());
    }
    Set<GearCharacteristicEntity> gearCharacteristics = gearEntity.getGearCharacteristics();
    if (CollectionUtils.isNotEmpty(gearCharacteristics)) {
        for (GearCharacteristicEntity charac : gearCharacteristics) {
            fillCharacteristicField(charac, gearDto);
        }
    }
}
Also used : FishingGearRoleEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity) GearCharacteristicEntity(eu.europa.ec.fisheries.ers.fa.entities.GearCharacteristicEntity)

Example 3 with FishingGearRoleEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class GearCharacteristicsMapper method fillRoleAndCharacteristics.

private void fillRoleAndCharacteristics(GearDto gearDto, FishingGearEntity gearEntity) {
    Set<FishingGearRoleEntity> fishingGearRole = gearEntity.getFishingGearRole();
    if (CollectionUtils.isNotEmpty(fishingGearRole)) {
        FishingGearRoleEntity role = fishingGearRole.iterator().next();
        gearDto.setRole(role.getRoleCode());
    }
    Set<GearCharacteristicEntity> gearCharacteristics = gearEntity.getGearCharacteristics();
    if (CollectionUtils.isNotEmpty(gearCharacteristics)) {
        for (GearCharacteristicEntity charac : gearCharacteristics) {
            fillCharacteristicField(charac, gearDto);
        }
    }
}
Also used : FishingGearRoleEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity) GearCharacteristicEntity(eu.europa.ec.fisheries.ers.fa.entities.GearCharacteristicEntity)

Aggregations

FishingGearRoleEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity)3 GearCharacteristicEntity (eu.europa.ec.fisheries.ers.fa.entities.GearCharacteristicEntity)2 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)1