JetBrains / JetBrains/Exposed

EntityHooks are not invoked when using DSL API

Open
#1,706 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Kotlin
Stars
9.3k
Forks
798
Avg merge
4d 2h
Merged PRs (30d)
26

Description

I'm using an EntityHook to sign up for changes in the database. When an entry is deleted, I want to create an entry in another table.
My problem is that when I'm using a Table.deleteWhere() clause, EntityHook is not invoked.
The only place where that entity hook is invoked, judging by the source code, is when the delete() method of the entity is called
([Entity.kt line 249](https://github.com/JetBrains/Exposed/blob/6b367afc6a71d973c1cecebb0b653c60461b236d/exposed-dao/src/main/kotlin/org/jetbrains/exposed/dao/Entity.kt#LL248C38-L248C52))

I want to listen to changes on any operation on a given table. How can I do this without using database triggers?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.