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?