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 Summary
Modifier and TypeMethodDescription<T> Object[]buildInsertMergeParams(ReferentialPayload<T> payload) Builds the parameter array for INSERT and all MERGE/upsert queries.int[]SQL types matchingbuildInsertMergeParams(com.societegenerale.failover.core.payload.ReferentialPayload<T>)column order.<T> Object[]buildUpdateParams(ReferentialPayload<T> payload) Builds the parameter array for the UPDATE query (SET columns first, then WHERE predicate).int[]SQL types matchingbuildUpdateParams(com.societegenerale.failover.core.payload.ReferentialPayload<T>)column order.@Nullable StringNative merge/upsert query for the detected database dialect, ornullwhen no known dialect is available — the store falls back to INSERT + UPDATE on duplicate in that case.
-
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_NAMEandFAILOVER_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_NAMEandFAILOVER_KEY
-
getCleanUpQuery
String getCleanUpQuery()- Returns:
- the DELETE SQL that removes all rows with
EXPIRE_ONbefore a given timestamp
-
getCountByNameQuery
String getCountByNameQuery()- Returns:
- the
SELECT COUNT(*)SQL counting all rows for a givenFAILOVER_NAME(capacity gauge)
-
getMergeQuery
@Nullable String getMergeQuery()Native merge/upsert query for the detected database dialect, ornullwhen no known dialect is available — the store falls back to INSERT + UPDATE on duplicate in that case. -
buildInsertMergeParams
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()SQL types matchingbuildInsertMergeParams(com.societegenerale.failover.core.payload.ReferentialPayload<T>)column order. -
buildUpdateParams
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()SQL types matchingbuildUpdateParams(com.societegenerale.failover.core.payload.ReferentialPayload<T>)column order.
-