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
Post a Comment