i have a question
parent class:
tracker.class,it contain tow child class
child class :
trackeritem.class
child calss:
Trackeremail.class
i want delete the all the child trackeritem of the parent tracker,i set the cascade=all
tracker tk=new tracker();
session.delete(tk);
i can't use above the way to delete ,because session.delete(tk) will delete not only all the trackeritems,but also all the trackeremails.
now i only want delete all the trackeritems.
if my code like this
Code:
for(Iterator ite=tk.getTrackeritems().iterator();ite.hasNext();){
tki=(Trackeritem)ite.next();
tk.getTrackeritems().remove(tki);
session.delete(tki);
}
will throw a error ConcurrentModificationException, how do i resolve it
thanks