# Use of targetAuditMode on field overrides the entity's withModifiedFlag parameter

**URL:** <https://discourse.hibernate.org/t/use-of-targetauditmode-on-field-overrides-the-entitys-withmodifiedflag-parameter/12050>\
**Category:** Hibernate ORM\
**Created:** [December 16, 2025, 9:07am UTC](https://discourse.hibernate.org/t/use-of-targetauditmode-on-field-overrides-the-entitys-withmodifiedflag-parameter/12050 "2025-12-16T09:07:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrobertklee](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@nrobertklee](https://discourse.hibernate.org/u/nrobertklee)\
**Post date:** [December 16, 2025, 9:07am UTC](https://discourse.hibernate.org/t/use-of-targetauditmode-on-field-overrides-the-entitys-withmodifiedflag-parameter/12050/1 "2025-12-16T09:07:10Z")

</div>

Hi,

Haven’t found another topic adressing the issue but feel free to notice me and close the topic if it has already been discussed and it is the expected behaviour :

I’ve audited my entity with modified flags enabled, with the annotation @Audited(withModifiedFlag = true) on the entity.

Works well with every field, excepted for those I use the @Audited(targetAuditMode = RelationTargetAuditMode.NOT\_AUDITED) annotation on. For those I need to add the withModifiedFlag parameter manually for it to be enabled on the field, while you would except the behavior to be inherited from the entity as for the other fields.

---

<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:** [December 16, 2025, 10:57am UTC](https://discourse.hibernate.org/t/use-of-targetauditmode-on-field-overrides-the-entitys-withmodifiedflag-parameter/12050/2 "2025-12-16T10:57:09Z")

</div>

I’m not sure what you expect exactly. You are annotating `@Audited` on a field which has a default for `withModifiedFlag` to be `false`, so not specifying that member is as if you wanted to override it to `false`. Hope that makes sense.

---

<div class="post-metadata">

**Author:** ![nrobertklee](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@nrobertklee](https://discourse.hibernate.org/u/nrobertklee)\
**Post date:** [December 16, 2025, 1:14pm UTC](https://discourse.hibernate.org/t/use-of-targetauditmode-on-field-overrides-the-entitys-withmodifiedflag-parameter/12050/3 "2025-12-16T13:14:12Z")

</div>

Thanks for your answer !

Yes, I thought it could be the expected behaviour but you could also expect that specifying it on the entity would take over the value on the field.

But well if that’s normal it’s fine by me, sorry for bothering you !

Have a nice day 🙂
