objectClass("Employee") {
update {
enabled false
}
}
SQL update operation
|
Since 4.11
This functionality is available since version 4.11.
|
Update operations apply ConnId deltas to the existing row with a single transactional SQL UPDATE.
This article is part of the SQL connector development reference and guidance materials. See How to develop connectors using the SQL framework for the section introduction.
Basic update
For a writable table, update works out of the box — no operation script is required.
The framework:
-
Loads the current row using the full UID mapping.
-
Applies each
AttributeDelta(replace, add, and remove forms) on top of the current values. -
Writes the resulting column values in one
UPDATEstatement, using the UID mapping as the exact predicate. -
Verifies that exactly one row was affected. The predicate is the full UID (primary key), so at most one row can match — the zero-row case fails with
UnknownUidException, and a defensive check raisesConnectorExceptionif the affected count is anything other than zero or one.
If the delta contains no attributes that map to writable SQL columns, the update is a no-op.
Connection failures are wrapped into ConnectionFailedException; failed transactions are rolled back.
Related-table attributes
If the object class has related-table attributes (see Multitable support: child tables and junction tables), update deltas for those attributes are handled in the same transaction:
-
add — inserts the new child-table rows
-
replace — replaces the existing child rows (physically delete + insert), preserving columns the connector does not manage
-
remove — deletes the matching child-table rows
A delta that would change the parent join column of an embedded value is rejected with ConnectorException. See Writing to child and junction tables for the full semantics.
Not-updatable attributes
The following attribute kinds cannot appear in an update delta.
The update operation fails with InvalidAttributeValueException if they do:
-
UID columns (primary key mapping)
-
Auto-increment / identity columns
-
Attributes marked read-only by the built-in mapping rules
Attributes whose columns are not writable by the database (for example, view-backed columns) are not part of any object class update in the first place.
Errors
| Condition | Exception |
|---|---|
No row matches the UID |
|
Invalid value or constraint violation (not-null, foreign key, check) |
|
Connection failure |
|
Exactly-one-row check failed |
|
A delta would change the parent join column of an embedded value |
|
Updates run in a transaction that is rolled back before the exception is returned. Unlike some REST/SCIM connectors, the SQL framework has a single update mode (partial delta) — there is no separate PUT/patch mode to configure.
Enabling / disabling update
The declaration mirrors disabling delete — the same enabled false operation block, under update instead of delete.
Unlike object-class-level readOnly true (which disables create, update and delete at once and is applied automatically to views), this disables only the update handler: the object class stays creatable and deletable. That is the right choice for immutable-but-deletable object classes — records that must not change once created but can still be removed — or when updates are intentionally routed elsewhere while create and delete remain available.
The same in YAML:
objectClasses:
Employee:
update:
enabled: false
Object classes marked readOnly true, and views, never get an update handler.
See also built-in mapping rules.