-->
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.  [ 1 post ] 
Author Message
 Post subject: Equivalent of JDOHelper ?
PostPosted: Wed Oct 19, 2005 12:32 pm 
Newbie

Joined: Wed Oct 19, 2005 6:57 am
Posts: 4
Location: Toulouse, FRANCE
Hi,
we're migrating a large application from JDO 1 to hibernate 3 and there is still a point we can't easily "translate" from the existing code.
Using JDO, we could use JDOHelper.isPersistent, JDOHelper.isNew, JDOHelper.isDeleted, ... to get the status of a persistent enity.
With Hibernate, it seems like the internal status should be reachable via ((SessionImplementor)session).getPersistenceContext().getEntry(...).getStatus().
But this is non intened for application use as the doc for Status states, unlike the JDOHelper stuff.
I know we can use interceptors to perform actions at transaction completion time for items which are saved or deleted, but it would require to rethink the calling code which expects to know way before the commit that an object is going to be persisted, removed, or is already persistent.
Maybe the best choice would be to use listeners on the SessionFactory to track "manually" the state of the entity.
Any idea ?
Thanks in advance

Olivier


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

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.