Class UniqueKeyHelper
java.lang.Object
com.kingsrook.qqq.backend.core.actions.tables.helpers.UniqueKeyHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTo make a list of unique key values here behave like they do in an RDBMS (which is what we're trying to mimic - which is - 2 null values in a field aren't considered the same, so they don't violate a unique key) (at least, that's how some RDBMS's work, right??) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<QRecord, Serializable> findMatches(QTableMetaData table, List<QRecord> records, UniqueKey key, boolean allowNullKeyValuesToEqual, InputSource inputSource, QBackendTransaction transaction) Match a complete Replace request against native READ-visible values.static Map<List<Serializable>, Serializable> getExistingKeys(QBackendTransaction transaction, QTableMetaData table, List<QRecord> recordList, UniqueKey uniqueKey) static Map<List<Serializable>, Serializable> getExistingKeys(QBackendTransaction transaction, QTableMetaData table, List<QRecord> recordList, UniqueKey uniqueKey, boolean allowNullKeyValuesToEqual) static Optional<List<Serializable>> getKeyValues(QTableMetaData table, UniqueKey uniqueKey, QRecord record) static Optional<List<Serializable>> getKeyValues(QTableMetaData table, UniqueKey uniqueKey, QRecord record, boolean allowNullKeyValuesToEqual) static IntegerGetter for pageSizestatic voidsetPageSize(Integer pageSize) Setter for pageSizestatic voidReserve in-request keys only after required-field and security validation.static voidPersisted conflicts remain checked at the existing INSERT unique-key phase.static voidValidate final sparse candidates without hydrating caller patches or replacing the ordinary access-checked old records.
-
Constructor Details
-
UniqueKeyHelper
public UniqueKeyHelper()
-
-
Method Details
-
validateUpdateUniqueKeys
Validate final sparse candidates without hydrating caller patches or replacing the ordinary access-checked old records. Existing other owners remain occupied.- Throws:
QException
-
validateInsertStoredKeys
Persisted conflicts remain checked at the existing INSERT unique-key phase.- Throws:
QException
-
validateInsertBatchKeys
Reserve in-request keys only after required-field and security validation. Customizer phase order is retained; AFTER_ALL_VALIDATIONS remains trusted.- Throws:
QException
-
findMatches
public static Map<QRecord,Serializable> findMatches(QTableMetaData table, List<QRecord> records, UniqueKey key, boolean allowNullKeyValuesToEqual, InputSource inputSource, QBackendTransaction transaction) throws QException Match a complete Replace request against native READ-visible values. The returned identity map never hydrates private matching fields into callers. Legacy bulk-insert helpers retain their existing tuple and Query contracts.- Throws:
QException
-
getExistingKeys
public static Map<List<Serializable>,Serializable> getExistingKeys(QBackendTransaction transaction, QTableMetaData table, List<QRecord> recordList, UniqueKey uniqueKey, boolean allowNullKeyValuesToEqual) throws QException - Throws:
QException
-
getExistingKeys
public static Map<List<Serializable>,Serializable> getExistingKeys(QBackendTransaction transaction, QTableMetaData table, List<QRecord> recordList, UniqueKey uniqueKey) throws QException - Throws:
QException
-
getKeyValues
public static Optional<List<Serializable>> getKeyValues(QTableMetaData table, UniqueKey uniqueKey, QRecord record, boolean allowNullKeyValuesToEqual) -
getKeyValues
public static Optional<List<Serializable>> getKeyValues(QTableMetaData table, UniqueKey uniqueKey, QRecord record) -
getPageSize
Getter for pageSize -
setPageSize
Setter for pageSize
-