You do not use interceptors to save the objects. You use it to modify/format the items and let the session object do the rest for your but not add new items.
If you really want to add a row at the end of the flush() or commit() then you use Spring-AOP to do that as one option. There you can add Advises to the hibernate services, so, you can save something immediately after running a method.
Work around I'd thought is the following.
public void postFlush(Iterator iterator) {
for(; iterator.hasNext();) {
if(!(iterator.next() instanceof Item)){ //<<<<< You verify if you are saving Item or //other objects, if saving Item, skip this block.
Session tempSession = HibernateUtil.hibernateTemplateLog
.getSessionFactory().openSession();
try {
Item item = new Item();
item.setName("anyItem");
item.setValue("anyValue");
tempSession.save(item);
tempSession.flush();
} finally {
tempSession.close();
}
}
}
}
}