javajavabeansdeep-copyapache-commons-beanutils

BeanUtils.cloneBean() deep copy


If all the objects within the bean implement Serializable interface, will BeanUtils.cloneBean() do a deep copy?


Solution

  • No, cloneBean() does shallow copy only. If you want deep copy. You may refer this link which has technique to do deep copy.