I have one class with specific columns, say
Class A
{
private String A;
private String B;
private String C;
// Getter Setter of respectives
}
Now what happened I have same value of column A and column B only column C's value change. So I do something like below
A a = new A();
a.setA(..);
a.setB(..);
for(i=0;i<length;i++){
a.setC(..);
getHibernateTemplate.saveOrUpdate(a);
// or something like this
// A a1 = new A();
// a1 = a;
// a1. setC(..);
// getHibernateTemplate.saveOrUpdate(a1);
}
My issue is it does not store length number of records, it only updates that single record.
I know the reason that hibernate access it as persistent object and even if I change value and again save it will update existing record and it can be resolve by taking new object every time and setting it all values. But I don't want it, is there any way to tell hibernate to save that record instead of updating?