@ -47,7 +47,7 @@ public interface StdJDBCConstants extends Constants {
String SCHED_NAME_SUBST = "{1}" ;
String SCHED_NAME_SUBST = "{1}" ;
// QUERIES
// QUERIES
String UPDATE_TRIGGER_STATES_FROM_OTHER_STATES = "UPDATE "
String UPDATE_TRIGGER_STATES_FROM_OTHER_2_ STATES = "UPDATE "
+ TABLE_PREFIX_SUBST
+ TABLE_PREFIX_SUBST
+ TABLE_TRIGGERS
+ TABLE_TRIGGERS
+ " SET "
+ " SET "
@ -60,6 +60,21 @@ public interface StdJDBCConstants extends Constants {
+ " = ? OR "
+ " = ? OR "
+ COL_TRIGGER_STATE + " = ?)" ;
+ COL_TRIGGER_STATE + " = ?)" ;
String UPDATE_TRIGGER_STATES_FROM_OTHER_3_STATES = "UPDATE "
+ TABLE_PREFIX_SUBST
+ TABLE_TRIGGERS
+ " SET "
+ COL_TRIGGER_STATE
+ " = ?"
+ " WHERE "
+ COL_SCHEDULER_NAME
+ " = " + SCHED_NAME_SUBST + " AND ("
+ COL_TRIGGER_STATE
+ " = ? OR "
+ COL_TRIGGER_STATE
+ " = ? OR "
+ COL_TRIGGER_STATE + " = ?)" ;
String SELECT_MISFIRED_TRIGGERS = "SELECT * FROM "
String SELECT_MISFIRED_TRIGGERS = "SELECT * FROM "
+ TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
+ TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
+ COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
+ COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
@ -212,8 +227,8 @@ public interface StdJDBCConstants extends Constants {
+ ", " + COL_NEXT_FIRE_TIME + ", " + COL_PREV_FIRE_TIME + ", "
+ ", " + COL_NEXT_FIRE_TIME + ", " + COL_PREV_FIRE_TIME + ", "
+ COL_TRIGGER_STATE + ", " + COL_TRIGGER_TYPE + ", "
+ COL_TRIGGER_STATE + ", " + COL_TRIGGER_TYPE + ", "
+ COL_START_TIME + ", " + COL_END_TIME + ", " + COL_CALENDAR_NAME
+ COL_START_TIME + ", " + COL_END_TIME + ", " + COL_CALENDAR_NAME
+ ", " + COL_MISFIRE_INSTRUCTION + ", " + COL_JOB_DATAMAP + ", " + COL_PRIORITY + ") "
+ ", " + COL_MISFIRE_INSTRUCTION + ", " + COL_JOB_DATAMAP + ", " + COL_PRIORITY + ", " + COL_APPOINT_ID + " ) "
+ " VALUES(" + SCHED_NAME_SUBST + ", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ;
+ " VALUES(" + SCHED_NAME_SUBST + ", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
String INSERT_SIMPLE_TRIGGER = "INSERT INTO "
String INSERT_SIMPLE_TRIGGER = "INSERT INTO "
+ TABLE_PREFIX_SUBST + TABLE_SIMPLE_TRIGGERS + " ("
+ TABLE_PREFIX_SUBST + TABLE_SIMPLE_TRIGGERS + " ("
@ -507,13 +522,24 @@ public interface StdJDBCConstants extends Constants {
+ " AND " + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " = ?" ;
+ " AND " + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " = ?" ;
String SELECT_NEXT_TRIGGER_TO_ACQUIRE = "SELECT "
String SELECT_NEXT_TRIGGER_TO_ACQUIRE = "SELECT "
+ COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
+ COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
+ COL_NEXT_FIRE_TIME + ", " + COL_PRIORITY + " FROM "
+ COL_NEXT_FIRE_TIME + ", " + COL_PRIORITY + " FROM "
+ TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
+ TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
+ COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
+ COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
+ " AND " + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " <= ? "
+ " AND " + COL_APPOINT_ID + " IS NULL"
+ "AND (" + COL_MISFIRE_INSTRUCTION + " = -1 OR (" + COL_MISFIRE_INSTRUCTION + " != -1 AND " + COL_NEXT_FIRE_TIME + " >= ?)) "
+ " AND " + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " <= ? "
+ "ORDER BY " + COL_NEXT_FIRE_TIME + " ASC, " + COL_PRIORITY + " DESC" ;
+ "AND (" + COL_MISFIRE_INSTRUCTION + " = -1 OR (" + COL_MISFIRE_INSTRUCTION + " != -1 AND " + COL_NEXT_FIRE_TIME + " >= ?)) "
+ "ORDER BY " + COL_NEXT_FIRE_TIME + " ASC, " + COL_PRIORITY + " DESC" ;
String SELECT_NEXT_APPOINT_TRIGGER_TO_ACQUIRE = "SELECT "
+ COL_TRIGGER_NAME + ", " + COL_TRIGGER_GROUP + ", "
+ COL_NEXT_FIRE_TIME + ", " + COL_PRIORITY + " FROM "
+ TABLE_PREFIX_SUBST + TABLE_TRIGGERS + " WHERE "
+ COL_SCHEDULER_NAME + " = " + SCHED_NAME_SUBST
+ " AND " + COL_APPOINT_ID + " = ?"
+ " AND " + COL_TRIGGER_STATE + " = ? AND " + COL_NEXT_FIRE_TIME + " <= ? "
+ "AND (" + COL_MISFIRE_INSTRUCTION + " = -1 OR (" + COL_MISFIRE_INSTRUCTION + " != -1 AND " + COL_NEXT_FIRE_TIME + " >= ?)) "
+ "ORDER BY " + COL_NEXT_FIRE_TIME + " ASC, " + COL_PRIORITY + " DESC" ;
String INSERT_FIRED_TRIGGER = "INSERT INTO "
String INSERT_FIRED_TRIGGER = "INSERT INTO "