shynate26 wrote:
Which entity u need to save ?
hi dear shynate26 can u plz gve me reply
id START_DATE EXPIRE_DATE PCODE
---------- ------------- -------------- ----------
5 23-APR-09 31-JUL-10 p001
6 01-AUG-09 08-NOV-09 p002
7 09-NOV-09 05-AUG-12 p003
8 09-NOV-09 05-AUG-12 p002
9 01-AUG-10 06-JUN-11 p001
here my requirement is using hibernate i want update(using criteria or hql)
1.suppose i have do save or update based on ourrequirement
2.suppose i enter with 10 01-AUG-11 06-JUN-12 p005
this is record is diffrent this is not matching with previous code like p001 or p002 or p003.....
3.so it will inserted...
4.when ever i enter same code like c002...i want update existing record and this record also i have to inserted(here two restictions suppose i entered stardate 09-dec-2016 with p002....in this time
based on p002 code 2 records is available..i want to call max(id) record..
after that we scould set poo2 EXPIRE_DATE is 08-dec-2016(ie means wat i have enter date that one
minus-1 as poo2code..