I am working with the com.j256.ormlite package.
My goal is to have a working database-file and a file the user can save with an UI-button to. To reach this goal I intent to track changes in the working file at the database abstraction layer and notify the user when he closes the program, that there is unsaved data.
How could I track if changes are made?
My first intuition is to write a decorator for the Dao Interface and wrap the Dao Creation in a single method, which uses my decorator.
The decorator could modify all update & delete methods. But the dao seems to support transactions and seems to be a complex and long interface.
How would you best solve my problem?