-->
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: How to write an algorithm for a Post Save in Base Dao?
PostPosted: Sat Jan 20, 2007 7:26 pm 
Beginner
Beginner

Joined: Thu Nov 16, 2006 11:34 am
Posts: 26
Location: Boston
I need to have a post save operation performed. Why cant i use an interceptor for this purpose? all the methods in Interceptor are before persisting

My requirement is written here in this post -
http://forum.hibernate.org/viewtopic.php?t=969997

Im thinking that Interceptor need not be the place to do this. Even If I try to do this in my baseDao like this

Code:
public final void save(DomainObject domainObject) {
      getHibernateTemplate().saveOrUpdate(domainObject);   
      
      String bigid = updateGridIdentifier(domainObject, domainObject.getClass().toString()
          +domainObject.getId().toString() );
          domainObject.setGridId(bigid);     
          getHibernateTemplate().saveOrUpdate(domainObject);         
              
   }


This will only set the id for my initial domainObject and NOT the nested collections present in this domain object. I would like to write a BaseDao method to be able to nest the object graph call the utility method to get the GridId, set it back to the hibernate object and finally call saveOrUpdate

Any idea how I could write this algorithm?


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.