| /* |
| ******************************************************************************* |
| * Copyright (c) 2019 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| ******************************************************************************* |
| */ |
| package org.eclipse.openk.contactbasedata.mapper; |
| |
| import org.eclipse.openk.contactbasedata.model.TblAddress; |
| import org.eclipse.openk.contactbasedata.viewmodel.AddressDto; |
| import org.mapstruct.Mapper; |
| import org.mapstruct.Mapping; |
| import org.mapstruct.Mappings; |
| import org.mapstruct.ReportingPolicy; |
| |
| @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| public interface AddressMapper { |
| |
| @Mappings({ |
| @Mapping( source="tblContact.uuid", target="contactUuid"), |
| @Mapping( source="wgs_84_zone", target="wgs84Zone"), |
| @Mapping( source="refAddressType.uuid", target="addressTypeUuid"), |
| @Mapping( source="refAddressType.type", target="addressTypeType"), |
| @Mapping( source="refAddressType.description", target="addressTypeDescription"), |
| }) |
| AddressDto toAddressDto(TblAddress tblAdress); |
| |
| @Mappings({ |
| |
| @Mapping( source="wgs84Zone", target="wgs_84_zone") |
| }) |
| TblAddress toTblAddress(AddressDto adressDto); |
| |
| } |