Search in sources :

Example 31 with AddressEntity

use of org.orcid.persistence.jpa.entities.AddressEntity in project ORCID-Source by ORCID.

the class MapperFacadeFactory method getAddressMapperFacade.

public MapperFacade getAddressMapperFacade() {
    MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
    ClassMapBuilder<Address, AddressEntity> addressClassMap = mapperFactory.classMap(Address.class, AddressEntity.class);
    addV3DateFields(addressClassMap);
    registerSourceConverters(mapperFactory, addressClassMap);
    addressClassMap.field("putCode", "id");
    addressClassMap.field("country.value", "iso2Country");
    addressClassMap.field("visibility", "visibility");
    addressClassMap.fieldBToA("displayIndex", "displayIndex");
    addressClassMap.byDefault();
    addressClassMap.register();
    return mapperFactory.getMapperFacade();
}
Also used : Address(org.orcid.jaxb.model.v3.dev1.record.Address) DefaultMapperFactory(ma.glasnost.orika.impl.DefaultMapperFactory) DefaultMapperFactory(ma.glasnost.orika.impl.DefaultMapperFactory) MapperFactory(ma.glasnost.orika.MapperFactory) AddressEntity(org.orcid.persistence.jpa.entities.AddressEntity)

Aggregations

AddressEntity (org.orcid.persistence.jpa.entities.AddressEntity)31 Date (java.util.Date)13 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)13 Test (org.junit.Test)9 OrcidDuplicatedElementException (org.orcid.core.exception.OrcidDuplicatedElementException)8 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)7 Address (org.orcid.jaxb.model.record_v2.Address)6 ExternalIdentifierEntity (org.orcid.persistence.jpa.entities.ExternalIdentifierEntity)6 OtherNameEntity (org.orcid.persistence.jpa.entities.OtherNameEntity)6 ProfileKeywordEntity (org.orcid.persistence.jpa.entities.ProfileKeywordEntity)6 ResearcherUrlEntity (org.orcid.persistence.jpa.entities.ResearcherUrlEntity)6 ApplicationException (org.orcid.core.exception.ApplicationException)5 Address (org.orcid.jaxb.model.v3.dev1.record.Address)5 Transactional (org.springframework.transaction.annotation.Transactional)5 HashMap (java.util.HashMap)4 Transactional (javax.transaction.Transactional)4 Visibility (org.orcid.jaxb.model.common_v2.Visibility)3 DBUnitTest (org.orcid.test.DBUnitTest)3 InvalidParameterException (java.security.InvalidParameterException)2 MapperFactory (ma.glasnost.orika.MapperFactory)2