Search in sources :

Example 1 with RegistrationLocationEntity

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

the class BaseMapper method mapToRegistrationLocationEntity.

public static RegistrationLocationEntity mapToRegistrationLocationEntity(RegistrationLocation registrationLocation, RegistrationEventEntity registrationEventEntity) {
    if (registrationLocation == null) {
        return null;
    }
    RegistrationLocationEntity registrationLocationEntity = RegistrationLocationMapper.INSTANCE.mapToRegistrationLocationEntity(registrationLocation);
    registrationLocationEntity.setRegistrationEvent(registrationEventEntity);
    return registrationLocationEntity;
}
Also used : RegistrationLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity)

Example 2 with RegistrationLocationEntity

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

the class RegistrationLocationMapperTest method testRegistrationLocationMapper.

@Test
public void testRegistrationLocationMapper() {
    RegistrationLocation registrationLocation = MapperUtil.getRegistrationLocation();
    RegistrationLocationEntity registrationLocationEntity = RegistrationLocationMapper.INSTANCE.mapToRegistrationLocationEntity(registrationLocation);
    assertTrue(registrationLocationEntity.getDescription().startsWith(registrationLocation.getDescriptions().get(0).getValue()));
    assertTrue(registrationLocationEntity.getName().startsWith(registrationLocation.getNames().get(0).getValue()));
    assertEquals(registrationLocation.getGeopoliticalRegionCode().getValue(), registrationLocationEntity.getRegionCode());
    assertEquals(registrationLocation.getGeopoliticalRegionCode().getListID(), registrationLocationEntity.getRegionCodeListId());
    assertEquals(registrationLocation.getCountryID().getValue(), registrationLocationEntity.getLocationCountryId());
    assertEquals(registrationLocation.getCountryID().getSchemeID(), registrationLocationEntity.getLocationCountrySchemeId());
    assertEquals(registrationLocation.getTypeCode().getValue(), registrationLocationEntity.getTypeCode());
    assertEquals(registrationLocation.getTypeCode().getListID(), registrationLocationEntity.getTypeCodeListId());
    assertNull(registrationLocationEntity.getRegistrationEvent());
}
Also used : RegistrationLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity) RegistrationLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation) Test(org.junit.Test)

Example 3 with RegistrationLocationEntity

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

the class ActivityDataUtil method getRegistrationLocationEntity.

public static RegistrationLocationEntity getRegistrationLocationEntity(String description, String regionCode, String regionCodeListId, String name, String typeCode, String typeCodeListId, String locationCountryId, String locationCountrySchemeId) {
    RegistrationLocationEntity registrationLocationEntity = new RegistrationLocationEntity();
    registrationLocationEntity.setDescription(description);
    registrationLocationEntity.setRegionCode(regionCode);
    registrationLocationEntity.setRegionCodeListId(regionCodeListId);
    registrationLocationEntity.setName(name);
    registrationLocationEntity.setTypeCode(typeCode);
    registrationLocationEntity.setTypeCodeListId(typeCodeListId);
    registrationLocationEntity.setLocationCountryId(locationCountryId);
    registrationLocationEntity.setLocationCountrySchemeId(locationCountrySchemeId);
    return registrationLocationEntity;
}
Also used : RegistrationLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity)

Aggregations

RegistrationLocationEntity (eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity)3 Test (org.junit.Test)1 RegistrationLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation)1