public static Customer convertEntityToCustomer(carrental.model.jpa.entities.Customer entity) { Customer customer = new Customer(); customer.setId(entity.getId()); customer.setFirstName(entity.getFirstName()); customer.setLastName(entity.getLastName()); customer.setIdCode(entity.getIdCode()); GregorianCalendar calendar = new GregorianCalendar(); calendar.setTime(entity.getRegisterDate()); customer.setRegisterDate(calendar); return customer; }