ruimo wrote:
Thanks! Your information really helps. I can get implementation object by following code.
Object o = ((HibernateProxy)obj).getHibernateLazyInitializer().getImplementation();
I noticed that if the persistent object has association such as List, its type is org.hibernate.collection.PersistentList.
Code:
public class Entity {
private List items = new ArrayList();
If I save this object into other database by Session.save(), the association seems to be ignored and not saved. I can avoid this issue to make new ArrayList object before saving this entity.
Code:
items = new Arraylist(items);
However, this seems a bit dirty trick to me. Does anyone know smarter way?