I tried searching this over the net but in vain. Is there a way to use hibernate to perform an idempotent update.
One use case is to use HTTP PUT to update a specific field in the database via a REST API. So for example, if I have a database with columns : Id, Name, Phone, UpdateDate and I update the Phone field (of a specific Id) with the same value multiple times only my first action must update the Phone(and also change my UpdateDate). Subsequent updates must have no effect on the record (and UpdateDate).
While this can be implemented in an application by first getting the record and comparing it against my input value before performing an update. I was wondering whether Hibernate has any inbuilt features?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…