apache commons beanutils - How to copy objects managed by Hibernate? -


i want copy object (its properties). object managed hibernate , has lazy collections. propertyutils.copyproperties() throws lazy exception.

is there way?

ps: not want unproxy object since don't own (its in jar)

you can call hibernate.initialize() on every lazy collectio of original object before copying. obviously, not work outside of transaction, if yor object detached hibernate session. so, have initialize lazy collections enough.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -