Is there a solution available to subscribe for domain object changes for Hibernate or any other mainstream O/R mapping framework? For example if I have a table in a database called "Apple" I'd like to be able to say "notify me when any Apple object changed" or "notify me when field "colour" of any Apple object changed". Of course I'd expect not just "something changed" notification but rather a list of id's of changed objects or a list of changed objects. Would be nice such solution to be scalable.
to summarize requirements:
Will all the changes that generate these notifications go through the ORM, or is it possible that data might be changed via JDBC or another application accessing the same database?
If all changes go through the ORM and you are using Hibernate, then you could use Hibernate's interceptors and events.
On the other hand, if all the changes to the data don't go through the ORM and the code that processes the notifications is fairly simple, database triggers might be a better bet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With