-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to determine entity state? #1711
Comments
Hi, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tl;dr: Is there any way of determining whether a DAO entity is being inserted, deleted or updated in the current transaction?
Context: I am maintaining an entity change tracker that needs to detect:
Leveraging Exposed's EntityHooks I get notified about the inserts and deletes but the updates get flushed before I am able to extract the updated values from writeValues and readValues. See the source.
This has lead me to extract the changes by overriding the entity flush function and log the changes before forwarding to the original flush, but then I cannot differentiate between updated and inserted entities. My best bet currently is to access the internal isNewEntity function via reflection.
Hence the question: is there any recommended way I can determine entity state? Or is there some other less convoluted approach I can take to implement my change tracker?
The text was updated successfully, but these errors were encountered: