Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Envers with named query (update)

I have envers running ok on my system, but when I modify an entity using a named query, envers doesn´t create the revision for this action.

Did anyone have this problem? Any solutions?

My named query looks like this:

update Formulario set f.ativo = :inativo
like image 893
Scandiuzzi Avatar asked Sep 03 '25 04:09

Scandiuzzi


1 Answers

Envers can't intercept bulk-update changes, only when you modify the entities via objects. That's due to the fact that an update HQL query is translated straight to SQL, and Hibernate has no idea which entities changed and how.

So the problem isn't connected with named queries, but with bulk query usage.

like image 119
adamw Avatar answered Sep 07 '25 12:09

adamw