Quartz’s api and Database Table Mapping Analysis

  quartz

Order

Since I want to extend quartz’s job and trigger’s query method to support paging, I will look at the corresponding table mapping against some api.

job

scheduler.getJobKeys(GroupMatcher.anyJobGroup());
scheduler.getJobDetail(JobKey.jobKey(name,group));

quartz-2.3.0-sources.jar! /org/quartz/impl/jdbcjobstore/StdJDBCDelegate.java

String SELECT_JOBS_IN_GROUP_LIKE = "SELECT " + COL_JOB_NAME + ", " + COL_JOB_GROUP
            + " FROM " + TABLE_PREFIX_SUBST + TABLE_JOB_DETAILS + " WHERE "
            + COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
            + " AND " + COL_JOB_GROUP + " LIKE ?";

Directly check the job_details table

trigger

scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(group));
scheduler.getTrigger(TriggerKey.triggerKey(name,group));

quartz-2.3.0-sources.jar! /org/quartz/impl/jdbcjobstore/StdJDBCDelegate.java

String SELECT_TRIGGERS_IN_GROUP_LIKE = "SELECT "
            + COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + " FROM " + TABLE_PREFIX_SUBST + TABLE_TRIGGERS
            + " WHERE " + COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
            + " AND " + COL_TRIGGER_GROUP + " LIKE ?";

Look up the TRIGGERS table

TRIGGERS table

  • QRTZ_TRIGGERS

Summary of trigger Information

  • QRTZ_SIMPLE_TRIGGERS

Details table of simple trigger type is associated with the summary table through trigger_name

  • QRTZ_CRON_TRIGGERS

The details table of cron trigger type is associated with the summary table through trigger_name.

  • QRTZ_BLOG_TRIGGERS

Details Table of Trigger Type Customized by Users with JDBC

doc