I have a need to execute a JQPL (or native, that could work too but I’d rather use JPQL) query from my ExtLoginScreen but it seems EntityManager isn’t available from there - I get an exception whether I try injection or AppBeans.get().
Am I stuck or is there a way to do it without EntityManager?
Well, another option - you can implement a service in the core module that uses EntityManager to execute DELETE statement and invoke this service in the screen controller.
True - I suppose. What I’m doing instead I think is I made the entity non-soft-delete (changed it to BaseUuidEntity) and I’ll just use dm.load() and dm.remove() to handle it.
This is quite true, and appropriate and even desired in this case. This entity represents generated codes for 2FA and thus soft-delete isn’t desirable or needed anyway.