Hibernate listener for create table DDL events


#1

I need to to capture events like create table using entity in hibernate. My application dynamically creates tables and need to audit these events.Is there any listener available for capturing the DDL statements?


#2

Hibernate has Event listeners for entity state transitions, not DDL structure.

It’s not even possible to change the DB schema dynamically without rebuilding the EntityManagerFactory.

For your use case, you are better off using Debezium.


#3

I need to do some operation after creating tables dynamically through SQLQuerry. Is there a way to add any listener or interceptor for the same


#4

Hibernate does not have anything for that. You will have to use something else.