Reputation: 4418
I have List of particular class. I want to save this List at a time without loop using Hibernate Transaction. Is it possible ?
Suppose i have a class
Class a{
private int no;
private String name;
public getNo(){
return this.no;
}
public setNo(int no){
this.no=no;
}
public getName(){
return this.name;
}
public setName(String name){
this.name=name;
}
}
now i have
List<a> list;
so i can save list directly without looping? If yes, than please help me.
Upvotes: 1
Views: 2514
Reputation: 4870
you can do this without loop
for that you need to use spring's hibernate utility
that utility like
getHibernateTemplate().saveOrUpdateAll(questionsCollection);
or
getHibernateTemplate().deleteAll(questionsCollection);
Upvotes: 3