Interface FailoverStoreQueryResolver

All Known Implementing Classes:
DefaultFailoverStoreQueryResolver

public interface FailoverStoreQueryResolver
Contract for resolving JDBC queries, binding parameters, and mapping result-set rows for the failover store.

Implementations own the SQL text, column ordering, SQL types, and result-set mapping so that schema changes require edits in exactly one place.

Author:
Anand Manissery
See Also:
  • Method Details

    • getInsertQuery

      String getInsertQuery()
      Returns:
      the INSERT SQL for a new row
    • getUpdateQuery

      String getUpdateQuery()
      Returns:
      the UPDATE SQL for an existing row (SET columns first, then WHERE predicate)
    • getSelectQuery

      String getSelectQuery()
      Returns:
      the SELECT SQL that retrieves a single row by FAILOVER_NAME and FAILOVER_KEY
    • getSelectAllByNameQuery

      String getSelectAllByNameQuery()
      Returns:
      the SELECT SQL that retrieves all rows for a given FAILOVER_NAME
    • getDeleteQuery

      String getDeleteQuery()
      Returns:
      the DELETE SQL that removes a single row by FAILOVER_NAME and FAILOVER_KEY
    • getCleanUpQuery

      String getCleanUpQuery()
      Returns:
      the DELETE SQL that removes all rows with EXPIRE_ON before a given timestamp
    • getCountByNameQuery

      String getCountByNameQuery()
      Returns:
      the SELECT COUNT(*) SQL counting all rows for a given FAILOVER_NAME (capacity gauge)
    • getMergeQuery

      @Nullable String getMergeQuery()
      Native merge/upsert query for the detected database dialect, or null when no known dialect is available — the store falls back to INSERT + UPDATE on duplicate in that case.
    • buildInsertMergeParams

      <T> Object[] buildInsertMergeParams(ReferentialPayload<T> payload)
      Builds the parameter array for INSERT and all MERGE/upsert queries. Column order: FAILOVER_NAME, FAILOVER_KEY, AS_OF, EXPIRE_ON, PAYLOAD, PAYLOAD_CLASS.
    • buildInsertMergeTypes

      int[] buildInsertMergeTypes()
    • buildUpdateParams

      <T> Object[] buildUpdateParams(ReferentialPayload<T> payload)
      Builds the parameter array for the UPDATE query (SET columns first, then WHERE predicate). Column order: AS_OF, EXPIRE_ON, PAYLOAD, PAYLOAD_CLASS, FAILOVER_NAME, FAILOVER_KEY.
    • buildUpdateTypes

      int[] buildUpdateTypes()