DTO pattern: Best way to copy properties between two objects
You can use Apache Commmons Beanutils. The API is org.apache.commons.beanutils.PropertyUtilsBean.copyProperties(Object dest, Object orig). It copies property values from the “origin” bean to the “destination” bean for all cases where the property names are the same. Now I am going to off topic. Using DTO is mostly considered an anti-pattern in EJB3. If your DTO and … Read more