我有以下实体和关联的侦听器
@Entity
@EntityListeners(InjuryListener::class)
class Injury(val description: String,
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE) val id: Long = 0)
@Singleton
class InjuryListener : PreDeleteEventListener {
@PreRemove
fun preRemove(injury: Injury) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun onPreDelete(event: PreDeleteEvent?): Boolean {
val injury = event?.entity as Injury
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
然而,当我删除 Injury 时,我的 InjuryListener 上的任何方法都不会被调用。关于为什么会这样的任何线索?