@Override
public CustomerEntity convertTo(Customer source, CustomerEntity destination) {
CustomerEntity result = null;
if (source instanceof CorporateCustomer) {
CorporateCustomerEntity corporateCustomerEntity = new CorporateCustomerEntity();
corporateCustomerEntity.setId(source.getId());
corporateCustomerEntity.setApartment(source.getApartment());
List<CarEntity> carEntities = DozerHelper.mapList(source.getCars(),
CarEntity.class);
corporateCustomerEntity.setCars(carEntities);
corporateCustomerEntity.setCity(source.getCity());
corporateCustomerEntity.setCompanyName(((CorporateCustomer) source)
.getCompanyName());
corporateCustomerEntity.setCountry(source.getCountry());
corporateCustomerEntity.setEmail(source.getEmail());
corporateCustomerEntity.setHouse(source.getHouse());
corporateCustomerEntity.setHousing(source.getHousing());
corporateCustomerEntity.setName(source.getName());
corporateCustomerEntity.setPassword(source.getPassword());
corporateCustomerEntity.setPatronymic(source.getPatronymic());
corporateCustomerEntity.setPhone(source.getPhone());
corporateCustomerEntity.setProvince(source.getProvince());
corporateCustomerEntity.setRole(source.getRole());
corporateCustomerEntity.setStreet(source.getStreet());
corporateCustomerEntity.setSurname(source.getSurname());
corporateCustomerEntity.setVatRegNo(((CorporateCustomer) source)
.getVatRegNo());
corporateCustomerEntity.setZip(source.getZip());
result = corporateCustomerEntity;
}
if (source instanceof PersonalCustomer) {