How to create n entry wid one column same as PK.,
July 16, 2008 at 6:52 PM
Hi Guys,
I am tring to insert the data in database table, I use <generator class="increment"> so that everytime the PK is incremented. the prob is I want the same primary key value (just as a value) to other column. please tell how to do that..like if I creaat my object as obj, then I hav obj.id() will aoutomaticaly b created and i wont set that but i want obj.val2() same as the ID which was automaticaly created..how to do that??
If I were assinged the id value from code I cud hav set the same value to my other field which I want same as ID like obj.id(5) obj.val2(5) but this 5 is internally created by hibernate.. :((