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++ - protocol buffers - generate NON-inline accessors -

c# - issue attaching/adding an entity object which is detached from the DB Context? -