EntityManager em = entityManagerFactory.createEntityManager();
AddressEntity entity = em.find(AddressEntity.class, contactId);
Address a = new Address();
a.setContactId(contactId);
if (entity != null) {
a.setStreet(entity.getStreet());
a.setCity(entity.getCity());
a.setZip(entity.getZip());
}
return a;
}