Hibernate version:
3.2
Hello,
I want to retrieve a proxy object of an entity using hibernate session and 'get(Class)'. Is it possible and how ?
Actually, when I use 'session.get(MyEntity.class)', it return an instance of MyEntity and not a proxy. So, when I change the entity using a setter, nothing is updated into the database or cache. I must use 'flush' or call an other method to synchronize the dirty object to the database.
When I use the same code in EJB3, it is the same trouble. The returned object is the entity, not the proxy so when I want to use a remote client, it don't work because it don't know the Entity class, only its interface.
|