Class RelatedRecordPickerAction
java.lang.Object
com.kingsrook.qqq.backend.core.actions.tables.picker.RelatedRecordPickerAction
Serves related-record pickers (QRelatedRecordPicker): query the target
table, prepare child rows, add them, and remove links. Every read and write
runs as the user through the standard actions (permissions, record security
locks, validation, audit). See docs/RELATED-RECORD-PICKER.md.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA picker with its tables and join fields worked out. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(RelatedRecordPickerInput input) Insert one child row per target (or per given record), all or nothing.prepare(RelatedRecordPickerInput input) Build (without saving) one child row per target, with defaults, values copied from the target, and the forced join values.query(RelatedRecordPickerInput input) Query the target table: the user's filter AND the picker's filter AND the search, one page, with hasMore (no count) and the already-linked targets.remove(RelatedRecordPickerInput input) Delete this parent's join rows for the given targets (LINK only).resolve(QInstance qInstance, QTableMetaData table, QRelatedRecordPicker picker) Resolve a picker's tables and join fields, or null when the metadata does not resolve (the validator reports why).Find a table's picker and resolve its tables and join fields.
-
Field Details
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMIT- See Also:
-
MAX_LIMIT
public static final int MAX_LIMIT- See Also:
-
-
Constructor Details
-
RelatedRecordPickerAction
public RelatedRecordPickerAction()
-
-
Method Details
-
resolve
public static RelatedRecordPickerAction.Resolved resolve(String tableName, String pickerName) throws QException Find a table's picker and resolve its tables and join fields.- Throws:
QNotFoundException- for an unknown table or pickerQException
-
resolve
public static RelatedRecordPickerAction.Resolved resolve(QInstance qInstance, QTableMetaData table, QRelatedRecordPicker picker) Resolve a picker's tables and join fields, or null when the metadata does not resolve (the validator reports why). -
query
Query the target table: the user's filter AND the picker's filter AND the search, one page, with hasMore (no count) and the already-linked targets.- Throws:
QException
-
prepare
Build (without saving) one child row per target, with defaults, values copied from the target, and the forced join values.- Throws:
QException
-
add
Insert one child row per target (or per given record), all or nothing.- Throws:
QException
-
remove
Delete this parent's join rows for the given targets (LINK only).- Throws:
QException
-