How to update a Hibernate entity when a column is updated externally

I have 2 applications and one database. First application use hibernate, second jdbs. I am updating data in database with SQL request in second app. How can I update my entity in first app if him already persistent?

If the entity is not stored in the second-level cache, you don’t need to do anything. The next time the entity is fetched, it will contain the new data.

However if the entity stored in the second level cashe can I to do anything to update entity?

Yes, you can evict it if you know the entity that has changed. You can know that using Debezium.

Check out this article on the Debezium blog for more details.