How to get SQL query from NHibernate save

I am trying to create a transaction type of recorded data that I can play in another database.

For example, I collect an order on the system when I save that I want to “export” an sql script that I can run in another database to create the same order.

I am using NHibernate and I am trying to catch the sql query string for a save operation to save to a file, but without success.

+3
source share
1 answer

Checkout this question: Get executable SQL from nHibernate

I'm not sure if there is a better alternative, like an event listener, if not, then the IInterceptor approach seems to be the best.

+1
source

Source: https://habr.com/ru/post/1736991/


All Articles