# Always update a given record even if its not dirty

**URL:** <https://discourse.hibernate.org/t/always-update-a-given-record-even-if-its-not-dirty/4795>\
**Category:** Hibernate ORM\
**Created:** [November 20, 2020, 10:54am UTC](https://discourse.hibernate.org/t/always-update-a-given-record-even-if-its-not-dirty/4795 "2020-11-20T10:54:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit\_chakra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/rohit_chakra/32/1281_2.png) [@rohit\_chakra](https://discourse.hibernate.org/u/rohit_chakra)\
**Post date:** [November 20, 2020, 10:54am UTC](https://discourse.hibernate.org/t/always-update-a-given-record-even-if-its-not-dirty/4795/1 "2020-11-20T10:54:49Z")

</div>

My requirement is to update a table’s record even though the record is not dirty. Hibernate is by default ignoring update query if all the columns that are passed are same. But I do not want that. Reason being, we have some triggers written on the database insert/update/delete, which needs to know if anyone trying to update any record. This is very critical element of the application and want it in this way.

I am browsing a lot on this, but finding about **@DynamicUpdate** , but what I want is the reverse of it.

Any help would be really helpful.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [November 23, 2020, 10:01am UTC](https://discourse.hibernate.org/t/always-update-a-given-record-even-if-its-not-dirty/4795/2 "2020-11-23T10:01:52Z")

</div>

As far as I know, this is not possible. You would have to write a custom update query like e.g.

```auto
entityManager.createQuery("UPDATE Entity e SET attribute1 = :attr1, attribute2 = :attr2 WHERE e.id = :id").executeUpdate();

```
