How can we store values in built-in tables like qrtz_job_details, qrtz_cron_triggers, qrtz_triggers programmatically?

I’m facing an issue while trying to interact with the built-in tables such as ‘qrtz_job_details’ , ‘qrtz_triggers’ and ‘qrtz_cron_triggers’ in Jmix. Specifically, I need to save values into these tables programmatically, but I couldn’t find any corresponding beans or classes for this purpose.

Guide me on how to store values in these tables through code?
Any help or pointers would be greatly appreciated.
I am using Jmix version : 2.2.0-232

There are several ways.
You can go to your Main Data Store and rightlick it and select Generate Model from Database, Refresh list, and then filter for what you need, in this case “q”
image

Check what you need, don’t generate the views if not needed, and you will have JPA entities now to work with.
You will have to write some code, and be very careful with this. Users will need access rights if they are not admin. It’s best to write a service using @Authenticated for this IMO.

Or, you can work with SQL queries directly, using Entity Manager, not Data Manager.
Use entityManager.createNativeQuery()

I would also look into JobModelListView, which is part of Jmix to see how it’s done.

Kind regards,
Mladen

1 Like

Try to use these entities:
image

1 Like