-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: session.get(Class) return concrete class or proxy ?
PostPosted: Sun Sep 03, 2006 1:32 pm 
Regular
Regular

Joined: Wed Sep 21, 2005 1:37 pm
Posts: 53
Location: Montpellier - France
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 05, 2006 3:46 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't really understand, but I recommend you to read http://www.hibernate.org/hib_docs/entitymanager/reference/en/html_single/
you seem to miss some key concepts

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.