I am using Jboss 4.2 with seam.
I have a problem. I need to convert entity that has been lazy fetched to it's original class, so I can persist it. Trying to persist entity that is lazy fetched (enhanced by javassist) would cause exception.
I have this problem because I can not declare persist cascade between main entity and sub entities which are lazily fetched. ( project tracks historical data, and unfortunately database does not have triggers )
I have managed to solve problem by using hibernate session
((Session)manager.getDelegate()).evict(main.getSubEntity()); SubEntity sub= manager.find(SubEntity.class,main.getSubEntity().getId()); osoba.setSubEntity(sub);